I am learning Bootstrap. I am using Bootstrap for a fixed-width design. From the online documentation, I know that it's easy to post items starting from a column. For instance:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bootstrap version</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <link href="css/bootstrap.css" rel="stylesheet"> <style type="text/css"> body { padding-top: 60px; padding-bottom: 40px; } </style> <link href="css/bootstrap-responsive.css" rel="stylesheet"> <link href="learn.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="row"> <div class="span3" style="background-color:grey">span3</div> <div class="span5" style="background-color:pink"><div id="text">span5 text</div></div> <div class="span4" style="background-color:navy">span4</div> </div> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/jquery-1.9.1.min.js"><\/script>')</script> <script src="js/bootstrap.min.js"></script> </body> </html>
In the example above
<div id="text">span5 text</div>
horizontally begins where the fourth column begins. I would like to know how Bootstrap expert users use CSS to host
<div id="text">span5 text</div>
so that it starts between the third and fourth columns or ends between the eighth and ninth columns.
I am thinking about using:
<style> #text { margin-left:-10px; } </style>
or
<style> #text { position:relative; left:-10px; } </style>
to position the div, but not sure if this is preferable, and would like to know what the experts are doing and some other ways.
Thanks!
source share