bootstrap 全局样式设置
HTML
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>全局样式</title>
- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
- </head>
- <body>
- <!-- Main jumbotron for a primary marketing message or call to action -->
- <div class="jumbotron">
- <h1>Hello, world!</h1>
- <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
- <p><a href="#" >Learn more »</a></p>
- </div>
- </body>
- </html>
CSS
- html {
- font-family: sans-serif;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
- }
- body {
- margin:;
- }
- article,
- aside,
- details,
- figcaption,
- figure,
- footer,
- header,
- hgroup,
- main,
- nav,
- section,
- summary {
- display: block;
- }
- audio,
- canvas,
- progress,
- video {
- display: inline-block;
- vertical-align: baseline;
- }
- audio:not([controls]) {
- display: none;
- height:;
- }
- [hidden],
- template {
- display: none;
- }
- a {
- background: transparent;
- }
- a:active,
- a:hover {
- outline:;
- }
- abbr[title] {
- border-bottom: 1px dotted;
- }
- b,
- strong {
- font-weight: bold;
- }
- dfn {
- font-style: italic;
- }
- h1 {
- margin: .67em 0;
- font-size: 2em;
- }
- mark {
- color: #000;
- background: #ff0;
- }
- small {
- font-size: 80%;
- }
- sub,
- sup {
- position: relative;
- font-size: 75%;
- line-height:;
- vertical-align: baseline;
- }
- sup {
- top: -.5em;
- }
- sub {
- bottom: -.25em;
- }
- img {
- border:;
- }
- svg:not(:root) {
- overflow: hidden;
- }
- figure {
- margin: 1em 40px;
- }
- hr {
- height:;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- }
- pre {
- overflow: auto;
- }
- code,
- kbd,
- pre,
- samp {
- font-family: monospace, monospace;
- font-size: 1em;
- }
- button,
- input,
- optgroup,
- select,
- textarea {
- margin:;
- font: inherit;
- color: inherit;
- }
- button {
- overflow: visible;
- }
- button,
- select {
- text-transform: none;
- }
- button,
- html input[type="button"],
- input[type="reset"],
- input[type="submit"] {
- -webkit-appearance: button;
- cursor: pointer;
- }
- button[disabled],
- html input[disabled] {
- cursor: default;
- }
- button::-moz-focus-inner,
- input::-moz-focus-inner {
- padding:;
- border:;
- }
- input {
- line-height: normal;
- }
- input[type="checkbox"],
- input[type="radio"] {
- box-sizing: border-box;
- padding:;
- }
- input[type="number"]::-webkit-inner-spin-button,
- input[type="number"]::-webkit-outer-spin-button {
- height: auto;
- }
- input[type="search"] {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- -webkit-appearance: textfield;
- }
- input[type="search"]::-webkit-search-cancel-button,
- input[type="search"]::-webkit-search-decoration {
- -webkit-appearance: none;
- }
- fieldset {
- padding: .35em .625em .75em;
- margin: 0 2px;
- border: 1px solid #c0c0c0;
- }
- legend {
- padding:;
- border:;
- }
- textarea {
- overflow: auto;
- }
- optgroup {
- font-weight: bold;
- }
- table {
- border-spacing:;
- border-collapse: collapse;
- }
- td,
- th {
- padding:;
- }
- @media print {
- * {
- color: #000 !important;
- text-shadow: none !important;
- background: transparent !important;
- box-shadow: none !important;
- }
- a,
- a:visited {
- text-decoration: underline;
- }
- a[href]:after {
- content: " (" attr(href) ")";
- }
- abbr[title]:after {
- content: " (" attr(title) ")";
- }
- a[href^="javascript:"]:after,
- a[href^="#"]:after {
- content: "";
- }
- pre,
- blockquote {
- border: 1px solid #999;
- page-break-inside: avoid;
- }
- thead {
- display: table-header-group;
- }
- tr,
- img {
- page-break-inside: avoid;
- }
- img {
- max-width: 100% !important;
- }
- p,
- h2,
- h3 {
- orphans:;
- widows:;
- }
- h2,
- h3 {
- page-break-after: avoid;
- }
- select {
- background: #fff !important;
- }
- .navbar {
- display: none;
- }
- .table td,
- .table th {
- background-color: #fff !important;
- }
- .btn > .caret,
- .dropup > .btn > .caret {
- border-top-color: #000 !important;
- }
- .label {
- border: 1px solid #000;
- }
- .table {
- border-collapse: collapse !important;
- }
- .table-bordered th,
- .table-bordered td {
- border: 1px solid #ddd !important;
- }
- }
Bootstrap框架在这一部分做了一定的变更,不再一味追求归零,而是更注重重置可能产生问题的样式(如,body,form的margin等),保留和坚持部分浏览器的基础样式,解决部分潜在的问题,提升一些细节的体验,具体说明如下:
- 移除body的margin声明
- 设置body的背景色为白色
- 为排版设置了基本的字体、字号和行高
- 设置全局链接颜色,且当链接处于悬浮“:hover”状态时才会显示下划线样式
Bootstrap的全局样式采用了“normalize.css”,但并没有一味的全部使用此重置样式,而是在此基础上进行了一些改良,让其更适合Bootstrap的设计思想。
bootstrap 全局样式设置的更多相关文章
- bootstrap全局样式二
加form-grope是为了以后更好的管理,一组form写一个form-grope 显示如下: 并排显示的话,给用户名前面再加一个div,再加horizontal,如下,并且加上control-lab ...
- bootstrap全局样式
内联子标题: 显示如下: 主体副本: 显示如下: 对齐类: 显示如下: 强调类: 显示如下: 缩略语: 地址: 表格: 加一个class:“table-striped” js里面的奇数偶数行(odd) ...
- [Bootstrap]全局样式(五)
辅助样式 1.情景文本色 .text-muted .text-primary .text-success .text-info .text-warning .text-danger {c ...
- [Bootstrap]全局样式(四)
按钮 1.基本类.btn {display/padding/margin-bottom/font-size/border-radius/border} 作用于< a:role:button &g ...
- [Bootstrap]全局样式(三)
表格 1.基本类 .table {width/margin-bottom/} {padding/border-top} e.g.:<table class="table" ...
- [Bootstrap]全局样式(二)
具体排版 1.标题和标题类 <h1> ~<h6>和.h1~h6|副标题<small>和.small font-size mar ...
- [Bootstrap]全局样式(一)
页面必须设置为html5文档类型 <!DOCTYPE html> <html lang="zh-CN"> ... </html> 适应移动设备 ...
- bootstrap 全局样式
reset.css html { font-family: sans-serif; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100% ...
- bootstrap全局CSS样式学习
参考http://v3.bootcss.com/css/,根据自己的记忆进行的复述,加深记忆. 首先介绍bootstrap全局CSS样式 只通过使用bootstrap.css,即可获得统一的样式设置. ...
随机推荐
- Unity PC端发布失败解决办法
Unity的PC端有时候发布的时候报错.原因可能是你的游戏里面使用了NGUI的label,而且字体选择的是unity自带的字体.因为支持中文.在选择unity自带的字体时最好都选一样的字体.如果一个l ...
- Java Map 按Key排序和按Value排序【转】【补】
package kingtool.sort; import java.util.ArrayList; import java.util.Collections; import java.util.Co ...
- Dubbo协议
参考dubbo官方文档http://dubbo.apache.org/zh-cn/docs/user/references/protocol/dubbo.html dubbo共支持如下几种通信协议: ...
- groovy.lang.GroovyRuntimeException: Conflicting module versions
在运行groovy的junit方法时,报了这个错误: java.lang.ExceptionInInitializerError at org.codehaus.groovy.reflection.C ...
- Git与GitHub学习笔记(五)一次提交失败的记录
代码已经跟踪了,添加注释说明,但是总是添加不了 error: pathspec 'live-page'' did not match any file(s) known to git. 重复了好多遍, ...
- Bootstrap的响应式后台管理模板推荐
1.Admin LTE 该模版开源免费.已用到项目中,客户评价说UI很好看... AdminLTE - 是一个完全响应式管理模板.基于Bootstrap3的框架.高度可定制的,易于使用.支持很多的屏幕 ...
- .NET面试题系列(十二)Dictionary原理
序言 Dictionary Dictionary的开发人员都了解,和List相比,字典添加会慢,但是查找会比较快. Dictionary的本质 --- 两个数组.这是典型的用空间换取时间的做法. 先来 ...
- POJ2031 Building a Space Station【最小生成树】
题意: 就是给出三维坐标系上的一些球的球心坐标和其半径,搭建通路,使得他们能够相互连通.如果两个球有重叠的部分则算为已连通,无需再搭桥.求搭建通路的最小边长总和是多少. 思路: 先处理空间点之间的距离 ...
- (原创 开源)AppWidge的使用—桌面便利贴
Android平台的一大特色就是支持桌面插件——AppWidget. 且不说,AppWidget是否会影响系统的流畅性,AppWidget确实是满足了用户个性化和快捷操作的需要. 常见的AppWidg ...
- 课程5:Spring框架2016版视频--视频列表目录
\day01视频\01-今天内容介绍.avi; \day01视频\02-spring的相关概念.avi; \day01视频\03-spring的ioc底层原理(一).avi; \day01视频\04- ...