Skip to content
Related Articles

Related Articles

How to create full width container in bootstrap5?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 10 Sep, 2020

Bootstrap containers are content holders that are used to align, add margins and padding to your content.  Bootstrap has three different container classes, namely: 

  • .container
  • .container-fluid
  • .container-{breakpoint}

Width of a container varies in accordance with its class. We can create a full width container in Bootstrap5 using “.container-fluid” class. It sets the container width equal to 100% in all screen sizes. This means the container spans the entire width of the viewport.


<div class= ".container-fluid">


<!DOCTYPE html>
        <link rel="stylesheet"
              crossorigin="anonymous" />
            .gfg {
                background-color: green;
                color: white;
                text-align: center;
        <div class="container-fluid gfg">


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!