Adding Top Margin to Rows in Twitter Bootstrap
The Twitter Bootstrap framework provides a convenient way to create responsive layouts. However, there may be times when you need to add additional top margin to a row element. While it's tempting to modify the existing "row" class, it's not recommended as this can lead to conflicts with the framework's core styling.
Solution:
Instead of modifying the "row" class, create a new class called "top-buffer" that adds the desired margin. Here's how to do it:
<code class="css">.top-buffer { margin-top: 20px; }</code>
<code class="html"><div class="row top-buffer"> ... </div></code>
By creating a separate class, you can target specific rows while preserving the default behavior of the "row" class for other situations. This approach maintains the integrity of the Bootstrap framework while allowing you to customize your layouts as needed.
The above is the detailed content of How to Add Top Margin to Rows in Twitter Bootstrap Without Modifying the \'row\' Class?. For more information, please follow other related articles on the PHP Chinese website!