How to vertically center a container in Bootstrap?

后端 未结 9 1443
囚心锁ツ
囚心锁ツ 2020-11-22 09:06

I\'m looking for a way to vertically center the container div inside the jumbotron and to set it in the middle of the page.

The .jum

9条回答
  •  逝去的感伤
    2020-11-22 09:39

    My prefered technique :

    body {
      display: table;
      position: absolute;
      height: 100%;
      width: 100%;
    }
    
    .jumbotron {
       display: table-cell;
       vertical-align: middle;
    }
    

    Demo

    body {
      display: table;
      position: absolute;
      height: 100%;
      width: 100%;
    }
    
    .jumbotron {
       display: table-cell;
       vertical-align: middle;
    }
    
    

    The easiest and powerful way

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    • Redirect
      Visitors where they converts more.

    • Track
      Views, Clicks and Conversions.

    • Check
      Constantly the status of your links.

    • Collaborate
      With Customers, Partners and Co-Workers.

    • GET STARTED
      FREE VERSION AVAILABLE!

    See also this Fiddle!

提交回复
热议问题