html - Jumbotron can't get centered -
i started using bootstrap. i'm having problem centering jumbotron. can't post image example because need 10 reputation. code:
<div class="container"> <div class="col-md-8 jumbotron center"> <h1>jumbotron heading</h1> <p class="lead">cras justo odio, dapibus ac facilisis in, egestas eget quam. fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p> <p><a class="btn btn-lg btn-success" href="#" role="button">sign today</a></p> </div> </div>
my css:
.jumbotron { border-bottom: 1px solid #e5e5e5; } .jumbotron .btn { padding: 14px 24px; font-size: 21px; } .center{ text-align: center; }
i'm sorry if solution easy i'm beginner web developer.
you've set size of jumbotron 8 columns on 'medium' , above (col-md-8
) no offsetting. means screen gets bigger bootstrap classes 'medium' change 100% 8/12s width.
if want width add offset class of 2 (col-md-offset-2
) or can rid of col-md-8
force 100% regardless of device width in example - http://jsfiddle.net/g8luy/1/
full width jumbtron
<div class="container"> <div class="jumbotron center"> ...your jumbtron html </div> </div>
'8/12ths' width jumbotron
<div class="container"> <div class="jumbotron col-md-8 col-md-offset-2 center"> ...your jumbtron html </div> </div>
you can read more on bootstrap grid system , various offsetting classes on website on 'css' page under 'grid system' - http://getbootstrap.com/css/#grid
Comments
Post a Comment