
Bootstrap讲全局font-size设置为14px,line-height设置为20px,段落的行高设置为10px,颜色设置为#333。我们可以通过在页面按F12查看body的样式 段落突出:通过.lead类可以让段落突出显示,我们来看演示代码:
<div class="container">
<p>卓越人生</p>
<p class="lead">从现在开始</p>
<p>走向人生巅峰</p>
</div>在Bootstrap中,标题可以有副标题,副标题比正标题的字体小一点,样式有点不太一样。
标记,把指定的内容标记出来。示例如下: 标记:I <span class="mark"> like </span> you 很久了 被span标签包起来的文本 you 的样式被添加背景色
1、 居左:class=”text-left” 2、 居中:class=”text-center” 3、 居右:class=”text-right”
示例代码:<span class="text-uppercase">i like you</span> 2 .小写:class=”text-lowercase” 示例代码:<span class="text-lowercase">I like you</span> 3.首字母大写:class=”text-capitalize” 示例代码:<span class="text-capitalize">i like you</span>
1.6. 缩略语:当鼠标悬停在缩写和缩写词上就会显示完整内容
示例代码:<abbr title="超文本标记语言">HTML</abbr>是一门超简单的网页语言<br>
示例代码:title="超文本标记语言" class="initialism">HTML</abbr>是一门超简单的网页语 注意:这两种的区别在于首字母缩略语的字体是 基本缩略语字体的90%大小
示例代码:<address>家庭地址:浪琴湾</address>
<address>公司地址:梅溪湖></address>1、默认样式的引用:<blockquote> <footer>
示例:<blockquote>阳光总在风雨后<footer>丹</footer></blockquote>
默认样式为左对齐
2、右对齐样式引用:<blockquote class=”blockquote-reverse”>
示例代码:<blockquote class="blockquote-reverse">阳光总在风雨后<footer><cite>丹</cite></footer></blockquote>
靠右对齐<ul class="list-unstyled">
<li>花间一壶酒</li>
<li>独酌无相亲</li>
<li>举杯邀明月,对影成三人</li>
</ul>示例代码: 花间一壶酒,独酌无相亲。<code>举杯邀明月,</code>对影成三人。 code标签包裹的内容加样式
示例代码: 复制快捷键:<kbd>Ctrl+C</kbd> 给kbd标签包裹起来的内容加样式
示例代码:
<pre>
花间一壶酒,独酌无相亲
举杯邀明月,
对影成三人
</pre>pre标签内的内容所有的空格 都会原样显示,标签内的文本编辑格式,会按照原样显示 设置pre区域显示垂直滚动条:<pre class=”pre-scrollable”> 代码示例:
<pre class="pre-scrollable">
花间一壶酒,独酌无相亲
举杯邀明月,
对影成三人
</pre>
咱们先来看一下我们平常写的table表格
<table>
<thead>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>
.......
</tbody>
</table>现在我们的表格是没有任何样式,没有边框没有对齐方式的。
<table class=”table”>
<thead>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>
.......
</tbody>
</table>现在再看效果,自动铺满,对齐,标题加粗,添加分割线。。
<table class=”table table-striped”>
<thead>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>
.......
</tbody>
</table>隔行就有背景色
<table class=”table table-bordered”>
<thead>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>
.......
</tbody>
</table>顾名思义 这个就是有边框的表格
<table class=”table table-hover”>
<thead>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>
.......
</tbody>
</table>鼠标移动到行就会显示效果
<table class=”table table-condensed”>
<thead>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>
.......
</tbody>
</table>顾名思义 紧缩表格,就是表格相对来说缩紧一些,仔细看行的上下两条线是不是缩紧了
<tr class="active">
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>设置行为灰色
<tr class="success"> <td>1</td> <td>张三</td> <td>男</td> <td>18</td> </tr> 设置行为绿色
设置行为蓝色
<tr class="info">
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr> <tr class="warning">
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>设置行为黄色
<tr class="danger">
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>设置行为红色
<tr class="table table-responsive">
<td>1</td>
<td>张三</td>
<td>男</td>
<td>18</td>
</tr>