Bootstrap 常用样式

常用标签

small,
.small {
  font-size: 80%; font-weight: 400;
}

mark,
.mark {
  padding: 0.2em; background-color: #fcf8e3;
}

code {
  font-size: 87.5%; color: #e83e8c; word-break: break-word;
}

common

.container,
.container-fluid {
  width: 100%; 
  padding-right: 15px; padding-left: 15px; 
  margin-right: auto; margin-left: auto;
}

.row {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -ms-flex-wrap: wrap; flex-wrap: wrap;
  margin-right: -15px; margin-left: -15px;
}

.flex-row {
  -webkit-box-orient: horizontal !important;  -webkit-box-direction: normal !important;
  -ms-flex-direction: row !important; flex-direction: row !important;
}

.flex-column {
  -webkit-box-orient: vertical !important; -webkit-box-direction: normal !important;
  -ms-flex-direction: column !important; flex-direction: column !important;
}

.no-gutters {  margin-right: 0; margin-left: 0; }

.clearfix::after { display: block; clear: both; content: ""; }

.d-none { display: none !important; }

.d-inline { display: inline !important; }

.d-inline-block { display: inline-block !important; }

.d-block {  display: block !important; }

.visible { visibility: visible !important; }

.invisible { visibility: hidden !important; }

.position-static { position: static !important; }

.position-relative { position: relative !important; }

.position-absolute { position: absolute !important; }

.position-fixed { position: fixed !important; }

.position-sticky { position: -webkit-sticky !important; position: sticky !important; }

.fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; }

.fixed-bottom { position: fixed; right: 0; bottom: 0; left: 0; z-index: 1030; }

.border { border: 1px solid #dee2e6 !important; }

.border-0 { border: 0 !important; }

.border-top-0 { border-top: 0 !important; }

.rounded { border-radius: 0.25rem !important; }

.rounded-0 { border-radius: 0 !important; }

.float-left { float: left !important; }

.float-right { float: right !important; }

.text-justify { text-align: justify !important; }

.text-nowrap { white-space: nowrap !important; }

.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.text-left { text-align: left !important; }

.text-right { text-align: right !important; }

.text-center { text-align: center !important; }

.text-lowercase { text-transform: lowercase !important; }

.text-uppercase { text-transform: uppercase !important; }

.text-capitalize { text-transform: capitalize !important; }

.text-justify { text-align: justify !important; }

.text-nowrap { white-space: nowrap !important; }

.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.float-none { float: none !important; }

.d-table { display: table !important; }

.d-table-row { display: table-row !important; }

.d-table-cell { display: table-cell !important; }

.d-flex {
  display: -webkit-box !important; display: -ms-flexbox !important; 
  display: flex !important;
}

.d-inline-flex {
  display: -webkit-inline-box !important;  display: -ms-inline-flexbox !important;
  display: inline-flex !important;
}

w | h

/* 
      w-25  /  w-50  /  w-75  /  w-100
 */
.w-25 { width: 25% !important; }

.h-25 { height: 25% !important; }

.h-100 { height: 100% !important; }

.mw-100 { max-width: 100% !important; }

.mh-100 { max-height: 100% !important; }

.m-0 {  margin: 0 !important; }

.mt-0 { margin-top: 0 !important; }

.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }

.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }

.p-0 { padding: 0 !important; }

/* ... */

.mt-1 { margin-top: 0.25rem !important; }

.mt-2 { margin-top: 0.5rem !important; }

.mt-3 { margin-top: 1rem !important; }

.mt-4 { margin-top: 1.5rem !important; }

.mt-5 { margin-top: 3rem !important; }

btn || bg || text

/*
  primary [007bff]   /    secondary [6c757d]   /   success [28a745]
  info [17a2b8]      /    warning [ffc107]     /   danger [dc3545]
  light [f8f9fa]     /    dark [343a40]
*/
.btn-primary {
  color: #fff; background-color: #007bff; border-color: #007bff;
}

.btn-outline-primary {
  color: #007bff; background-color: transparent; background-image: none; border-color: #007bff;
}

.btn-block { display: block; width: 100%; }

.bg-primary {  background-color: #007bff !important; }

.text-primary {  color: #007bff !important; }

.text-muted { color: #6c757d !important; }

@media

/* 
  sm (min-width: 576px)  /  md (min-width: 768px)  /  
  lg (min-width: 992px)  /  xl (min-width: 1200px)  /  
  print
 */
.d-sm-none { display: none !important; }

.d-print-none { display: none !important; }

变化类

.fade {
 opacity: 0;
 transition: opacity 0.15s linear;
}

.fade.show {
 opacity: 1;
}

.collapse {
 display: none;
}

.collapse.show {
 display: block;
}

justify || align

/* 
  start  /  end  /  center  /  between  /  around
 */
.justify-content-center {
  -webkit-box-pack: center !important; -ms-flex-pack: center !important;
  justify-content: center !important;
}
/* ------------------------------------------------ */
.align-content-center {
  -ms-flex-line-pack: center !important;
  align-content: center !important;
}

align

/* 
  start  /  end  /  center  /  baseline/  stretch
 */
.align-items-center {
  -webkit-box-align: center !important; -ms-flex-align: center !important;
  align-items: center !important;
}

.align-self-center {
  -ms-flex-item-align: center !important;
  align-self: center !important;
}
/* ------------------------------------------------ */
.align-self-auto {
  -ms-flex-item-align: auto !important;
  align-self: auto !important;
}

:root

:root {
  --blue: #007bff;
  --indigo: #6610f2;
  --purple: #6f42c1;
  --pink: #e83e8c;
  --red: #dc3545;
  --orange: #fd7e14;
  --yellow: #ffc107;
  --green: #28a745;
  --teal: #20c997;
  --cyan: #17a2b8;
  --white: #fff;
  --gray: #6c757d;
  --gray-dark: #343a40;
  --primary: #007bff;
  --secondary: #6c757d;
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --light: #f8f9fa;
  --dark: #343a40;
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 200,738评论 5 472
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 84,377评论 2 377
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 147,774评论 0 333
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,032评论 1 272
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,015评论 5 361
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,239评论 1 278
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,724评论 3 393
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,374评论 0 255
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,508评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,410评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,457评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,132评论 3 316
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,733评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,804评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,022评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,515评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,116评论 2 341

推荐阅读更多精彩内容

  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 2,689评论 0 3
  • ¥开启¥ 【iAPP实现进入界面执行逐一显】 〖2017-08-25 15:22:14〗 《//首先开一个线程,因...
    小菜c阅读 6,340评论 0 17
  • 明天就要去旅行啦。我很兴奋,因为我要拖着我的小行李箱,我是第一次拖哟。 爸爸妈妈和我要去塞班岛。塞...
    秋天的丘阅读 584评论 0 51
  • 【R】 名言好书: 人生不在于做多少事,而在于把重要的事情专注做,用心做,把它做到极致。 管理学大师德鲁克:一个人...
    亲子教育小六阅读 93评论 0 1