0

I am looking for Twitter Bootstrap examples and do not understand how all elements in this example are centered? Using what tag or style?

asked Apr 9, 2014 at 19:05

2 Answers 2

2

It is because .container div is centered using auto margins.

.container {
 margin-right: auto;
 margin-left: auto;
}

Also .jumbotron has

text-align: center;

attribute which centers the the child 'Sign up' button.

answered Apr 9, 2014 at 19:08
Sign up to request clarification or add additional context in comments.

Comments

0

Check out the helper classes in bootstrap here

Center content blocks Set an element to display: block and center via margin. Available as a mixin and class.

<div class="center-block">...</div>
 // Classes
 .center-block {
 display: block;
 margin-left: auto;
 margin-right: auto;
 }
 // Usage as mixins
.element {
 .center-block();
}
answered Apr 9, 2014 at 19:38

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.