官术网_书友最值得收藏!

Final thoughts

Before ending this chapter, we must get some things clear. Bootstrap offers some helper classes mixins and some vendor's mixins, which offer cross-browser compatibility support.

Box-sizing

Bootstrap 3 started using box-sizing: border-box for all elements and pseudo-elements. With this enabled, the width and height properties start to include the padding and the border but not the margin.

With that, it is easier to set the right sizing for your elements. This is because any change that you make in the element, such as customizing the padding of a .row, will reflect the width and height of the whole element. The following figure shows you the differences of box-sizing.

Box-sizing

Note

Pseudo-elements are the text placed after the : sign in the CSS style. They are used to style specific parts of elements, such as :after and :before, which are the most common pseudo-elements.

Quick floats

Bootstrap offers quick classes to make an element float. Add the .pull-left or .pull-right class to make the elements float left or right, respectively. Keep in mind that both classes apply the !important modifier to avoid override issues:

<div class="pull-left"></div>
<div class="pull-right"></div>

Note

In the next chapters, we will present the navbar components. Remember that if you want to align an element inside a navbar, you should use .navbar-left and .navbar-right instead of .pull-left and .pull-right.

Clearfix

Clearfix is a way of clearing the floating of an element related to its child element. The Bootstrap columns are all floated left, and the parent row has a clearfix. This makes every column appear right next to each other, and the row does not overlap with other rows. This figure exemplifies how clearfix works:

Clearfix

So, if you want to add the clearfix to a new element or pseudo-element, add the .clearfix class and you can get the hard work quickly done.

Font definitions for typography

In the following table, the font sizes for default text and heading are presented. It describes the heading, font family, and line height. It is important to make it explicit for you to deeply understand the Bootstrap default configuration if you want a different customization.

主站蜘蛛池模板: 商丘市| 鲁甸县| 北流市| 二连浩特市| 江源县| 五台县| 双桥区| 揭东县| 崇阳县| 绍兴县| 盐池县| 桐城市| 左贡县| 博野县| 白城市| 兴国县| 西畴县| 阳新县| SHOW| 北票市| 抚顺市| 赣榆县| 通化市| 盐山县| 灵寿县| 昌宁县| 垦利县| 镶黄旗| 峨边| 香格里拉县| 东丽区| 望谟县| 兴义市| 阿拉善右旗| 潼关县| 射洪县| 高台县| 怀宁县| 平潭县| 内黄县| 长汀县|