4.13 页面标题
源码文件:type.less
CSS文件:bootstrap.css 561行之后
页面标题(Page header)在2.x版是一个基础排版样式,在新版里划成了CSS组件,但没有进行功能的扩展。对于该组件,Bootstrap中的.page-header样式提供了类似h1元素的显示效果,只不过margin和底部padding距离稍大一些,底部有1像素的边框稍大一些。使用方式如下:
- <div class="page-header">
- <h1>Example page header <small>Subtext for header</small></h1>
- </div>
上述代码的运行效果如图4-66所示。
图4-66 页面标题运行效果
下面页面标题的源码非常简单,请自行理解。
- // 源码561行
- .page-header {
- padding-bottom: 9px; /* 设置底部内边距*/
- margin: 40px 0 20px; /* 设置上下外边距*/
- border-bottom: 1px solid #eee; /* 设置底部边框为1像素,并设置颜色*/
- }