Bootstrap知识记录:排版样式
---恢复内容开始---
一.页面排版
Bootstrap 提供了一些常规设计好的页面排版的样式供开发者使用。
1.页面主体
Bootstrap 将全局font-size 设置为14px,line-height 行高设置为1.428(即
20px);<p>段落元素被设置等于1/2 行高(即10px);颜色被设置为#333。
//创建包含段落突出的文本
<p>Bootstrap 框架</p>
<p class="lead">Bootstrap 框架</p>
<p>Bootstrap 框架</p>
<p>Bootstrap 框架</p>
<p>Bootstrap 框架</p>
2.标题
//从h1 到h6
<h1>Bootstrap 框架</h1> //36px
<h2>Bootstrap 框架</h2> //30px
<h3>Bootstrap 框架</h3> //24px
<h4>Bootstrap 框架</h4> //18px
<h5>Bootstrap 框架</h5> //14px
<h6>Bootstrap 框架</h6> //12px
我们从Firebug 查看元素了解到,Bootstrap 分别对h1 ~ h6 进行了CSS 样式的重构,
并且还支持普通内联元素定义class=(.h1 ~ h6)来实现相同的功能。
//内联元素使用标题字体
<span class="h1">Bootstrap</span>
注:通过Firebug 查看元素还看到,字体颜色、字体样式、行高均被固定了,从而保
证了统一性,而原生的会根据系统内置的首选字体决定,颜色是最黑色。
在h1 ~ h6 元素之间,还可以嵌入一个small 元素作为副标题,
//在标题元素内插入small 元素
<h1>Bootstrap 框架<small>Bootstrap 小标题</small></h1>
<h2>Bootstrap 框架<small>Bootstrap 小标题</small></h2>
<h3>Bootstrap 框架<small>Bootstrap 小标题</small></h3>
<h4>Bootstrap 框架<small>Bootstrap 小标题</small></h4>
<h5>Bootstrap 框架<small>Bootstrap 小标题</small></h5>
<h6>Bootstrap 框架<small>Bootstrap 小标题</small></h6>
通过Firebug 查看,我们发现h1 ~ h3 下small 元素的大小只占父元素的65%,那么
通过计算(查看Firebug 计算后的样式),h1 ~ h3 下的small 为23.4px、19.5px、15.6px;
h4 ~ h6 下small 元素的大小只占父元素的75% ,分别为:13.5px、10.5px、9px。
在h1 ~ h6 下的small 样式也进行了改变,颜色变成淡灰色:#777,行高为1,粗度
为400。
3.内联文本元素
//添加标记,<mark>元素或.mark 类
<p>Bootstrap<mark>框架</mark></p>
//各种加线条的文本
<del>Bootstrap 框架</del> //删除的文本
<s>Bootstrap 框架</s> //无用的文本
<ins>Bootstrap 框架</ins> //插入的文本
<u>Bootstrap 框架</u> //效果同上,下划线文本
//各种强调的文本
<small>Bootstrap 框架</small> //标准字号的85%
<strong>Bootstrap 框架</strong> //加粗700
<em>Bootstrap 框架</em> //倾斜
4.对齐
//设置文本对齐
<p class="text-left">Bootstrap 框架</p> //居左
<p class="text-center">Bootstrap 框架</p> //居中
<p class="text-right">Bootstrap 框架</p> //居右
<p class="text-justify">Bootstrap 框架</p> //两端对齐,支持度不佳
<p class="text-nowrap">Bootstrap 框架</p> //不换行
5.大小写
//设置英文文本大小写
<p class="text-lowercase">Bootstrap 框架</p> //小写
<p class="text-uppercase">Bootstrap 框架</p> //大写
<p class="text-capitalize">Bootstrap 框架</p>//首字母大写
6.缩略语
//缩略语
Bootstrap<abbr title="Bootstrap" class="initialism">框架</abbr>
7.地址文本
//设置地址,去掉了倾斜,设置了行高,底部20px
<address>
<strong>Twitter, Inc.</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
<abbr title="Phone">P:</abbr> (123) 456-7890
</address>
8.引用文本
//默认样式引用,增加了做边线,设定了字体大小和内外边距
<blockquote>
Bootstrap 框架
</blockquote>
//反向
<blockquote class="blockquote-reverse ">
Bootstrap 框架
</blockquote>
9.列表排版
//移出默认样式
<ul class="list-unstyled">
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
</ul>
//设置成内联
<ul class="list-inline">
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
<li>Bootstrap 框架</li>
</ul>
//水平排列描述列表
<dl class="dl-horizontal">
<dt>Bootstrap</dt>
<dd>Bootstrap 提供了一些常规设计好的页面排版的样式供开发者使用。</dd>
</dl>
10.代码
//内联代码
---恢复内容结束---
Bootstrap知识记录:排版样式的更多相关文章
- Bootstrap -- 网格系统、排版样式类、 <blockquote>、 <abbr> 元素
Bootstrap -- 网格系统.排版样式类. <blockquote>. <abbr> 元素 1. Bootstrap 提供了一套响应式.移动设备优先的流式网格系统,随着屏 ...
- Bootstrap知识记录:表单和图片
一.表单Bootstrap 提供了一些丰富的表单样式供开发者使用.1.基本格式//实现基本的表单样式<form><div class="form-group"&g ...
- Bootstrap知识记录:表格和按钮
基本格式.table3.带边框的表格//给表格增加边框<table class="table table-bordered">4.悬停鼠标//让<tbody> ...
- bootstrap课程3 bootstrap中常用的排版样式有哪些
bootstrap课程3 bootstrap中常用的排版样式有哪些 一.总结 一句话总结:bootstrap里面对常用表情比如p.h1.code等html中的常用表情都修改了样式,照着手册用就好,样式 ...
- bootstrap入门-4.排版及其他固定样式
本篇包括以下内容:排版.代码.表格.表单. 总结:超无聊,弃更. · 排版样式 标题 h1-h6 取消加粗,字体大小也有一定变化 ...
- Bootstrap 一. 排版样式(内联文本元素,对齐,大小写,缩略语,地址文本,引用文本,列表排版 ,代码 )
第 2 章 排版样式 在 h1 ~ h6 元素之间,还可以嵌入一个 small 元素作为副标题 <h1>Bootstrap 框架 <small>Bootstrap 小标题< ...
- bootstrap之排版样式
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 第二百三十二节,Bootstrap排版样式
Bootstrap排版样式 学习要点: 1.页面排版 本节课我们主要学习一下 Bootstrap 全局 CSS 样式中的排版样式,包括了标题.页面 主体.对齐.列表等常规内容. 一.页面排版 Boot ...
- Web前端理论知识记录
Web前端理论知识记录 Elena· 5 个月前 cookies,sessionStorage和localStorage的区别? sessionStorage用于本地存储一个会话(session) ...
随机推荐
- 制作CSS绚烂效果的三种属性
animation(动画).transition(过渡).transform(变形) https://www.cnblogs.com/shenfangfang/p/5713564.html
- F. Graph Without Long Directed Paths Codeforces Round #550 (Div. 3)
F. Graph Without Long Directed Paths time limit per test 2 seconds memory limit per test 256 megabyt ...
- C# - 汉字与unicode之间的转换
/// <summary> /// 字符串转Unicode码 /// </summary> /// <returns>The to unicode.</ret ...
- 雅礼集训【Day6-1】字符串
雅礼集训[Day6-1]字符串 假设我们有串\(a\),我们设\(a'\)为\(a\)翻转后按为取反过后的串. 我们只考虑前一半的,长为\(m\)的串.如果前半截匹配了\(a\)或者\(a'\),则\ ...
- Jenkins+Ansible+Gitlab自动化部署三剑客-Jenkins本地搭建
后面需要shell基础,目前没有,等有了,再更
- UltraISO制作Ubuntu14.04 64bit到U盘文件载入不完整
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/zinss26914/article/details/37728251 前言 今天新买的Thinkpa ...
- Python 属性与方法 概念理解
属性与方法 attribute(属性)是class(类)中的成员变量,而method(方法)则是class(类)中的function(函数). 也可以理解,属性就类变量,方法就是类函数. 类中的变量就 ...
- [Git] Git操作命令
基础操作 git配置 git config --global user.name "Your Name" git config --global user.email " ...
- [Python] Python 100例
题目1:有四个数字:1.2.3.4,能组成多少个互不相同且无重复数字的三位数?各是多少? 程序分析:可填在百位.十位.个位的数字都是1.2.3.4.组成所有的排列后再去 掉不满足条件的排列. #程序源 ...
- TensorFlow 学习资料
感谢几位大神的笔记: https://blog.csdn.net/column/details/13300.html?&page=3 https://blog.csdn.net/u014595 ...