Move Columns To The Right Using .col-md-offset-* Classes, Which ...

Move columns to the right using .col-md-offset-* classes, which increase the left margin of a column by * columns - HTML CSS Bootstrap

HTML CSS examples for Bootstrap:Grid Layout

Description

Move columns to the right using .col-md-offset-* classes, which increase the left margin of a column by * columns

Demo Code

ResultView the demo in separate window

<!DOCTYPEhtml> <html> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> </head> <body> <div class="container-fluid"> <h1>Offsetting Columns</h1> <p>Resize the browser window to see the effect.</p> <div class="row" style="background-color:lavender;"> <div class="col-sm-5 col-md-6" style="background-color:lightgray;">.col-sm-5 .col-md-6</div> <div class="col-sm-5 col-sm-offset-2 col-md-6 col-md-offset-0" style="background-color:lightcyan;">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div> </div> </div> </body> </html>

Related Tutorials

  • Mixed Mobile And Desktop
  • Grid columns should add up to twelve for a row. More than that, columns will stack.
  • Use Clear floats to prevent strange wrapping with uneven content
  • Change the order of the grid columns with .col-md-push-* and .col-md-pull-* classes:
  • Support Large Devices

Từ khóa » Html Col-md-offset