Answer the question
In order to leave comments, you need to log in
How to set container width to 100% in Bootstrap 5?
Visually, the width looks like it's set to 95%. The container itself is wrapped as container-fluid
This is what it looks like in my browser
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="jumbotron">
<h1>hello</h1>
</div>
</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
The easiest way is to just override the bootstrap properties with your own properties, but the padding data is done as an airbag for your layout, because when the screen width decreases, it may happen that the text, etc. will go off screen.
You need to understand how the bootstrap grid works.
If you need to set the background for the header, you can use a wrapper
<div class="header">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="jumbotron">
<h1>hello</h1>
</div>
</div>
</div>
</div>
</div>
.header {
background: gray;
}
<div class="container-fluid">
<div class="row header">
<div class="col-md-12">
<div class="jumbotron">
<h1>hello</h1>
</div>
</div>
</div>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question