首页>基础>排版

排版

文章转载,请注明出处 H-ui前端框架,网址http://www.h-ui.net/

3.1.1 标题

h1. 大标题小标题

h2. 大标题小标题

h3. 大标题小标题

h4. 大标题小标题

h5. 大标题小标题
h6. 大标题小标题
HTML SCSS CSS
<h1>h1. 大标题<small>小标题</small></h1>
<h2>h2. 大标题<small>小标题</small></h2>
<h3>h3. 大标题<small>小标题</small></h3>
<h4>h4. 大标题<small>小标题</small></h4>
<h5>h5. 大标题<small>小标题</small></h5>
<h6>h6. 大标题<small>小标题</small></h6>
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
  line-height: 1.1;
  color: inherit;
  small {
    font-weight: 400;
    line-height: 1;
    color: #999;
  }
}
h1,
h2,
h3 {
  padding-top: 20px;
  padding-bottom: 10px;
  small,
  .small {
    font-size: 65%;
  }
}
h4,
h5,
h6 {
  margin-top: 10px;
  margin-bottom: 10px;
  small,
  .small {
    font-size: 75%;
  }
}

h1 {
  font-size: 36px;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 24px;
}
h4 {
  font-size: 18px;
}
h5 {
  font-size: 14px;
}
h6 {
  font-size: 12px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
  line-height: 1.1;
  color: inherit;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small {
  font-weight: 400;
  line-height: 1;
  color: #999;
}

h1,
h2,
h3 {
  padding-top: 20px;
  padding-bottom: 10px;
}
h1 small,
h1 .small,
h2 small,
h2 .small,
h3 small,
h3 .small {
  font-size: 65%;
}

h4,
h5,
h6 {
  margin-top: 10px;
  margin-bottom: 10px;
}
h4 small,
h4 .small,
h5 small,
h5 .small,
h6 small,
h6 .small {
  font-size: 75%;
}

h1 {
  font-size: 36px;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 18px;
}

h5 {
  font-size: 14px;
}

h6 {
  font-size: 12px;
}

可根据自己的实际项目情况进行重写,为了保持h-ui正常升级,最好保持h-ui文件不动,在自己定义的css文件中重写。

3.1.2 强调

这是段落,向下10像素间距

小型文本,是父容器字体大小的85%

重要文本,加粗显示

被强调的文本,斜体显示

带下划线的文本

引用的内容

突出显示文本

带删除线的文本

huige 大写字母

HUIGE 小写字母

huige 首字母大写

HTML CSS
<p>这是段落,向下10像素间距</p>
<smail>小型文本,是父容器字体大小的85%</smail>
<strong>重要文本,加粗显示</strong>
<em>被强调的文本,斜体显示</em>
<u>带下划线的文本</u>
<cite>引用</cite>
<mark>突出显示文本</mark>
<del>带删除线的文本</del>
<p class="uppercase">huige 大写字母</p>
<p class="lowercase">HUIGE 小写字母</p>
<p class="capitalize">huige 首字母大写</p>
p {
  margin-bottom: 10px;
}

/*段落*/
small {
  font-size: 85%;
}

/*小型文本*/
b,
strong {
  font-weight: bold;
}

/*重要的文本,加粗*/
em {
  font-style: italic;
}

cite {
  font-style: normal;
}

/*引用*/
mark {
  color: #000;
  background: #ff0;
}

/*计算机代码文本*/
dfn {
  font-style: italic;
}

/*删除线*/
del {
  font-family: Simsun;
}

code,
kbd,
pre,
samp {
  font-family: monospace, serif;
  font-size: 1em;
}

pre {
  white-space: pre-wrap;
}

/*预格式化的文本*/
.uppercase {
  text-transform: uppercase;
}

/*文字大写*/
.lowercase {
  text-transform: lowercase;
}

/*文字小写*/
.capitalize {
  text-transform: capitalize;
}

/*首字母大写*/
.en {
  font-family: Arial !important;
}

3.1.3 对齐

左对齐
居中对齐
右对齐
居上对齐 居中对齐 距底对齐
.va-t .va-m .va-b
HTML CSS
<div class="text-l">左对齐</div>
<div class="text-c">居中对齐</div>
<div class="text-r">右对齐</div>
<table class="table hui-table-border hui-table-bordered">
  <tr>
    <th class="va-t" height="50">居上对齐</th>
    <th class="va-m">居中对齐</th>
    <th class="va-b">距底对齐</th>
  </tr>
  <tr>
    <td class="va-t" height="50">.va-t</td>
    <td class="va-m">.va-m</td>
    <td class="va-b">.va-b</td>
  </tr>
</table>
.text-l {
  text-align: left;
}

.text-r {
  text-align: right;
}

.text-c {
  text-align: center;
}

.va * {
  vertical-align: sub !important;
  *vertical-align: middle !important;
  _vertical-align: middle !important;
}

.va-t {
  vertical-align: top !important;
}

.va-m {
  vertical-align: middle !important;
}

.va-b {
  vertical-align: bottom !important;
}

3.1.4 定位

HTML CSS
class="pos-r|pos-a|pos-f"

.pos-r 相对定位, .pos-a 绝对定位, .pos-f 固定

.pos-r{position:relative}
.pos-a{position:absolute}
.pos-f{position:fixed}

3.1.5 浮动

左浮动右浮动
HTML CSS
<div class="clearfix"><span class="f-l">左浮动</span><span class="f-r">右浮动</span></div>
.f-l {
  float: left !important;
  _display: inline;
}

.f-r {
  float: right !important;
  _display: inline;
}

[class*=span].f-r {
  float: right;
}

注意: 浮动的父级元素一定要用 clearfix 清除浮动,否则高度会无法撑开。

/*控制元素对定位的位置:居左|居右|j居上|居下*/

注意:须配合position 属性使用。

.pos-left {
  left: 0;
  right: auto;
}

.pos-right {
  right: 0;
  left: auto;
}

.pos-top {
  top: 0;
  bottom: auto;
}

.pos-bottom {
  top: auto;
  bottom: 0;
}

3.1.6 文字单行溢出省略号

我是很长很长的文字,我的所在的容器尺寸有限,所以我溢出了,并且显示省略号
HTML CSS
<div class="text-overflow" style="width:300px;">我是很长很长的文字,我的所在的容器尺寸有限,所以我溢出了,并且显示省略号</div>
.text-overflow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

3.1.7 线条

HTML CSS
<div class="line"></div>
.line {
  font-size: 0;
  line-height: 0;
  border-top: solid 1px #eee;
  float: none;
}

3.1.8 外边距

参考线
蓝色div,距上面红色线条10像素
HTML CSS
<div class="mt-10">距上10像素</div>

.mt 表示上边距,.mb 表示下边距,.ml 表示左边距,.mr 表示右边距

支持任何块级元素,如果行内元素要想使用margin,请使用 display:block 先将其转化为块级元素

.mt-5 {
  margin-top: 5px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-15 {
  margin-top: 15px;
}

.mt-20 {
  margin-top: 20px;
}

.mt-25 {
  margin-top: 25px;
}

.mt-30 {
  margin-top: 30px;
}

.mt-35 {
  margin-top: 35px;
}

.mt-40 {
  margin-top: 40px;
}

.mt-50 {
  margin-top: 50px;
}

.mb-5 {
  margin-bottom: 5px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-15 {
  margin-bottom: 15px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-30 {
  margin-bottom: 30px;
}

.mb-40 {
  margin-bottom: 40px;
}

.mb-50 {
  margin-bottom: 50px;
}

.ml-5 {
  margin-left: 5px;
}

.ml-10 {
  margin-left: 10px;
}

.ml-15 {
  margin-left: 15px;
}

.ml-20 {
  margin-left: 20px;
}

.ml-30 {
  margin-left: 30px;
}

.ml-40 {
  margin-left: 40px;
}

.ml-50 {
  margin-left: 50px;
}

.mr-5 {
  margin-right: 5px;
}

.mr-10 {
  margin-right: 10px;
}

.mr-15 {
  margin-right: 15px;
}

.mr-20 {
  margin-right: 20px;
}

.mr-30 {
  margin-right: 30px;
}

.mr-40 {
  margin-right: 40px;
}

.mr-50 {
  margin-right: 50px;
}

注意: 上下模块不要同时使用margin-top和margin-bottom,会存在兼容性问题,所以上下模块之间的间距统一使用下一个模块的margin-top来实现,另一个优点是:如果没有下一个模块也不会多出一段空隙。

margin的兼容性问题:div设置左浮动,margin-left在ie中会出现2倍边距bug,解决办法:在style里面添加display:inline。

3.1.9 内填充

10像素填充,来点背景效果更明显
HTML CSS
<div class="pd-10">10像素填充</div>
.pt-5 {
  padding-top: 5px;
}

.pt-10 {
  padding-top: 10px;
}

.pt-15 {
  padding-top: 15px;
}

.pt-20 {
  padding-top: 20px;
}

.pt-25 {
  padding-top: 25px;
}

.pt-30 {
  padding-top: 30px;
}

.pb-5 {
  padding-bottom: 5px;
}

.pb-10 {
  padding-bottom: 10px;
}

.pb-15 {
  padding-bottom: 15px;
}

.pb-20 {
  padding-bottom: 20px;
}

.pb-25 {
  padding-bottom: 25px;
}

.pb-30 {
  padding-bottom: 30px;
}

.pl-5 {
  padding-left: 5px;
}

.pl-10 {
  padding-left: 10px;
}

.pl-15 {
  padding-left: 15px;
}

.pl-20 {
  padding-left: 20px;
}

.pl-25 {
  padding-left: 25px;
}

.pl-30 {
  padding-left: 30px;
}

.pr-5 {
  padding-right: 5px;
}

.pr-10 {
  padding-right: 10px;
}

.pr-15 {
  padding-right: 15px;
}

.pr-20 {
  padding-right: 20px;
}

.pr-25 {
  padding-right: 25px;
}

.pr-30 {
  padding-right: 30px;
}

.pd-5 {
  padding: 5px;
}

.pd-10 {
  padding: 10px;
}

.pd-15 {
  padding: 15px;
}

.pd-20 {
  padding: 20px;
}

.pd-25 {
  padding: 25px;
}

.pd-30 {
  padding: 30px;
}

.pd-40 {
  padding: 40px;
}

3.1.10 边框,css3圆角

边框
圆角边框
HTML CSS
<div class="bk-gray">边框</div><div class="bk-gray radius">圆角边框</div>
.bk-gray {
  border: solid 1px #eee;
}

.radius {
  border-radius: 4px;
}
.radius.size-MINI {
  border-radius: 3px;
}
.radius.size-L {
  border-radius: 5px;
}
.radius.size-XL {
  border-radius: 6px;
}

.round {
  border-radius: 50%;
  overflow: hidden;
}

3.1.11 css3阴影

css3阴影效果
css3文字阴影效果
HTML SCSS CSS
<div class="box-shadow">css3阴影效果</div>
<span class="text-shadow">css3文字阴影效果</span>
.box-shadow {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow {
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

圆角阴影可以组合使用。

css3 圆角阴影效果

3.1.12 行内分割竖线

注册|登录
文字
文字
文字
HTML SCSS CSS
<span class="hui-pipe">|</span>
<div class="hui-divider text-l">
  <div class="hui-divider-box">
    <span class="hui-divider-text">文字</span>
  </div>
</div>

<div class="hui-divider">
  <div class="hui-divider-box">
    <span class="hui-divider-text">文字</span>
  </div>
</div>

<div class="hui-divider text-r">
  <div class="hui-divider-box">
    <span class="hui-divider-text">文字</span>
  </div>
</div>
.hui-pipe {
  margin: 0 5px;
  color: #ccc;
  font-size: 10px!important
}

.hui-divider {
  position: relative;
  margin: 24px 0;
  height: 1px;
  width: 100%;
  min-width: 100%;
  border-top: solid 1px #ddd;
  .hui-divider-box {
    position: absolute;
    left: 0;
    right: 0;
    top: -11px;
    text-align: center;
    .hui-divider-text {
      background-color: #fff;
      padding: 0 10px;
      line-height: 20px;
      height: 20px;
      font-size: 16px;
      font-weight: 500;
      color: rgba(0,0,0,.85);
      white-space: nowrap;
      text-align: center;
    }
  }
  &.text-l {
    .hui-divider-box {
      text-align: left;
      padding-left: 20px;
    }
  }
  &.text-r {
    .hui-divider-box {
      text-align: right;
      padding-right: 20px;
    }
  }
}
.hui-pipe {
  margin: 0 5px;
  color: #ccc;
  font-size: 10px !important;
}

.hui-divider {
  position: relative;
  margin: 24px 0;
  height: 1px;
  width: 100%;
  min-width: 100%;
  border-top: solid 1px #ddd;
}
.hui-divider .hui-divider-box {
  position: absolute;
  left: 0;
  right: 0;
  top: -11px;
  text-align: center;
}
.hui-divider .hui-divider-box .hui-divider-text {
  background-color: #fff;
  padding: 0 10px;
  line-height: 20px;
  height: 20px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  text-align: center;
}
.hui-divider.text-l .hui-divider-box {
  text-align: left;
  padding-left: 20px;
}
.hui-divider.text-r .hui-divider-box {
  text-align: right;
  padding-right: 20px;
}

3.1.13 文字尺寸

12px 字体

14px 字体

16px 字体

18px 字体

20px 字体

24px 字体

26px 字体

28px 字体

30px 字体

列出一些常用的,常规字号。

HTML CSS
<p class="f-12">12px 字体</p>
<p class="f-14">14px 字体</p>
<p class="f-16">16px 字体</p>
<p class="f-18">18px 字体</p>
<p class="f-20">20px 字体</p>
<p class="f-24">24px 字体</p>
<p class="f-26">26px 字体</p>
<p class="f-28">28px 字体</p>
<p class="f-30">30px 字体</p>
.f-12 {
  font-size: 12px;
}

.f-14 {
  font-size: 14px;
}

.f-16 {
  font-size: 16px;
}

.f-18 {
  font-size: 18px;
}

.f-20 {
  font-size: 20px;
}

.f-22 {
  font-size: 22px;
}

.f-24 {
  font-size: 24px;
}

.f-26 {
  font-size: 26px;
}

.f-28 {
  font-size: 28px;
}

.f-30 {
  font-size: 30px;
}

3.1.14 文字行距

16像素行距

18像素行距

20像素行距

22像素行距

24像素行距

26像素行距

28像素行距

30像素行距

HTML CSS
<p class="lh-16">16像素行距</p>
<p class="lh-18">18像素行距</p>
<p class="lh-20">20像素行距</p>
<p class="lh-22">22像素行距</p>
<p class="lh-24">24像素行距</p>
<p class="lh-26">26像素行距</p>
<p class="lh-28">28像素行距</p>
<p class="lh-30">30像素行距</p>
.lh-16 {
  line-height: 16px;
}

.lh-18 {
  line-height: 18px;
}

.lh-20 {
  line-height: 20px;
}

.lh-22 {
  line-height: 22px;
}

.lh-24 {
  line-height: 24px;
}

.lh-26 {
  line-height: 26px;
}

.lh-28 {
  line-height: 28px;
}

.lh-30 {
  line-height: 30px;
}

根据黄金比例0.618,h-ui在css reset中已将全局body,th,td,button,input,select,textarea行高定为文本的1.6倍。

当然如果个人不喜欢,可以二次重写。

3.1.15 文字颜色

主色

次色

强调色 - 成功

强调色 - 危险

强调色 - 警告

强调色 - 出错

辅助色 - #333333灰

辅助色 - #666666灰

辅助色 - #999999灰

标准色 - 红色

标准色 - 绿色

标准色 - 蓝色

标准色 - 白色,为了看到效果,加个背景

标准色 - 黑色字体

标准色 - 橙色

HTML SCSS CSS
<p class="c-primary">主色</p>
<p class="c-secondary">次色</p>
<p class="c-success">强调色-成功</p>
<p class="c-error">强调色-错误</p>
<p class="c-warning">强调色-警告</p>
<p class="c-333">辅助色-#333333灰色</p>
<p class="c-666">辅助色-#666666灰色</p>
<p class="c-999">辅助色-#999999灰色</p>
<p class="c-red">标准色-红色</p>
<p class="c-green">标准色-绿色</p>
<p class="c-blue">标准色-蓝色</p>
<p class="c-white">标准色-白色</p>
<p class="c-black">标准色-黑色</p>
<p class="c-orange">标准色-橙色</p>
body {
  background-color: #fff;
  color: #333;
  .bg-fff {
    background-color: #fff;
  }
  a {
    color: #333;
  }
  a:hover,
  .active a {
    color: #06c;
  }
  .c-primary,
  .c-primary a,
  a.c-primary {
    color: $primary-color;
  }
  .c-primary a:hover,
  a.c-primary:hover {
    color: $primary-color;
  }

  .c-secondary,
  .c-secondary a,
  a.c-secondary {
    color: #555;
  }
  .c-secondary a:hover,
  a.c-secondary:hover {
    color: #555;
  }

  .c-success,
  .c-success a,
  a.c-success {
    color: $secondary-color;
  }
  .c-success a:hover,
  a.c-success:hover {
    color: $secondary-color
  }

  .c-danger,
  .c-danger a,
  a.c-danger {
    color: $danger-color
  }
  .c-danger a:hover,
  a.c-danger:hover {
    color: $danger-color
  }

  .c-warning,
  .c-warning a,
  a.c-warning {
    color: $warning-color;
  }
  .c-warning a:hover,
  a.c-warning:hover {
    color: $warning-color;
  }

  .c-error,
  .c-error a,
  a.c-error {
    color: $error-color;
  }
  .c-error a:hover,
  a.c-error:hover {
    color: $error-color;
  }

  .c-333,
  .c-333 a,
  a.c-333 {
    color: #333
  }
  .c-333 a:hover,
  a.c-333:hover {
    color: #333
  }

  .c-666,
  .c-666 a,
  a.c-666 {
    color: #666
  }
  .c-666 a:hover,
  a.c-666:hover {
    color: #666
  }

  .c-999,
  .c-999 a,
  a.c-999 {
    color: #999
  }
  .c-999 a:hover,
  a.c-999:hover {
    color: #999
  }

  .c-red,
  .c-red a,
  a.c-red {
    color: red
  }
  .c-red a:hover,
  a.c-red:hover {
    color: red
  }

  .c-green,
  .c-green a,
  a.c-green {
    color: green
  }
  .c-red a:hover,
  a.c-red:hover {
    color: green
  }

  .c-blue,
  .c-blue a,
  a.c-blue {
    color: blue
  }
  .c-blue a:hover,
  a.c-blue:hover {
    color: blue
  }

  .c-white,
  .c-white a,
  a.c-white {
    color: white
  }
  .c-white a:hover,
  a.c-white:hover {
    color: white
  }

  .c-black,
  .c-black a {
    color: #000;
  }
  .c-black a:hover,
  a.c-black:hover {
    color: #000;
  }

  .c-orange,
  .c-orange a,
  a.c-orange {
    color: orange;
  }
  .c-orange a:hover,
  a.c-orange:hover {
    color: orange;
  }
}
body {
  background-color: #fff;
  color: #333;
}
body .bg-fff {
  background-color: #fff;
}
body a {
  color: #333;
}
body a:hover,
body .active a {
  color: #06c;
}
body .c-primary,
body .c-primary a,
body a.c-primary {
  color: #5a98de;
}
body .c-primary a:hover,
body a.c-primary:hover {
  color: #5a98de;
}
body .c-secondary,
body .c-secondary a,
body a.c-secondary {
  color: #555;
}
body .c-secondary a:hover,
body a.c-secondary:hover {
  color: #555;
}
body .c-success,
body .c-success a,
body a.c-success {
  color: #3bb4f2;
}
body .c-success a:hover,
body a.c-success:hover {
  color: #3bb4f2;
}
body .c-danger,
body .c-danger a,
body a.c-danger {
  color: #dd514c;
}
body .c-danger a:hover,
body a.c-danger:hover {
  color: #dd514c;
}
body .c-warning,
body .c-warning a,
body a.c-warning {
  color: #f37b1d;
}
body .c-warning a:hover,
body a.c-warning:hover {
  color: #f37b1d;
}
body .c-error,
body .c-error a,
body a.c-error {
  color: #c00;
}
body .c-error a:hover,
body a.c-error:hover {
  color: #c00;
}
body .c-333,
body .c-333 a,
body a.c-333 {
  color: #333;
}
body .c-333 a:hover,
body a.c-333:hover {
  color: #333;
}
body .c-666,
body .c-666 a,
body a.c-666 {
  color: #666;
}
body .c-666 a:hover,
body a.c-666:hover {
  color: #666;
}
body .c-999,
body .c-999 a,
body a.c-999 {
  color: #999;
}
body .c-999 a:hover,
body a.c-999:hover {
  color: #999;
}
body .c-red,
body .c-red a,
body a.c-red {
  color: red;
}
body .c-red a:hover,
body a.c-red:hover {
  color: red;
}
body .c-green,
body .c-green a,
body a.c-green {
  color: green;
}
body .c-red a:hover,
body a.c-red:hover {
  color: green;
}
body .c-blue,
body .c-blue a,
body a.c-blue {
  color: blue;
}
body .c-blue a:hover,
body a.c-blue:hover {
  color: blue;
}
body .c-white,
body .c-white a,
body a.c-white {
  color: white;
}
body .c-white a:hover,
body a.c-white:hover {
  color: white;
}
body .c-black,
body .c-black a {
  color: #000;
}
body .c-black a:hover,
body a.c-black:hover {
  color: #000;
}
body .c-orange,
body .c-orange a,
body a.c-orange {
  color: orange;
}
body .c-orange a:hover,
body a.c-orange:hover {
  color: orange;
}

3.1.16 缩略语

这是缩略语 UI
HTML CSS
<abbr title="User Interface" class="initialism">UI</abbr>
abbr[title],
abbr[data-original-title] {
  cursor: help;
  border-bottom: 1px dotted #999;
}

abbr.initialism {
  font-size: 90%;
  text-transform: uppercase;
}

3.1.17 地址

北京市海淀区中关村……
HTML CSS
<address>北京市海淀区中关村……</address>
address {
  display: block;
  margin-bottom: 20px;
  font-style: normal;
  line-height: 20px;
}

3.1.18 引用

这是引用的内容

p标签显示的引用内容

small标签显示小号字体
这是引用的内容,右对齐效果

p标签显示的引用内容

small标签显示小号字体
HTML SCSS CSS
<blockquote>这是引用的内容
  <p>p标签显示的引用内容</p>
  <small>small标签显示小号字体</small>
</blockquote>
<blockquote class="text-r">
  这是引用的内容,右对齐效果
  <p>p标签显示的引用内容</p>
  <small>small标签显示小号字体</small>
</blockquote>
blockquote {
  padding: 0 0 0 15px;
  margin: 0 0 20px;
  border-left: 5px solid #eee;
  p {
    margin-bottom: 0;
    font-size: 17.5px;
    font-weight: 300;
    line-height: 1.25;
  }
  small {
    display: block;
    line-height: 20px;
    color: #999;
  }
  &.text-r {
    padding-right: 15px;
    padding-left: 0;
    border-right: 5px solid #eee;
    border-left: 0;
    p {
      text-align: right;
    }
    small {
      text-align: right;
      &:before {
        content: '';
      }
    }
  }
}
q:before,
q:after,
blockquote:before,
blockquote:after {
  content: ""
}
q {
  /*短的引用*/
  quotes: "\201C" "\201D" "\2018" "\2019";
}
blockquote {
  padding: 0 0 0 15px;
  margin: 0 0 20px;
  border-left: 5px solid #eee;
}
blockquote p {
  margin-bottom: 0;
  font-size: 17.5px;
  font-weight: 300;
  line-height: 1.25;
}
blockquote small {
  display: block;
  line-height: 20px;
  color: #999;
}
blockquote.text-r {
  padding-right: 15px;
  padding-left: 0;
  border-right: 5px solid #eee;
  border-left: 0;
}
blockquote.text-r p {
  text-align: right;
}
blockquote.text-r small {
  text-align: right;
}
blockquote.text-r small:before {
  content: "";
}

q:before,
q:after,
blockquote:before,
blockquote:after {
  content: "";
}

q {
  /*短的引用*/
  quotes: "“" "”" "‘" "’";
}

3.1.19 上标 下标

平方米m2
二氧化碳CO2
HTML CSS
m<sup>2</sup>
CO<sub>2</sub>
sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}
sup {
  top: -0.5em;
}
sub {
  bottom: -0.25em;
}

3.1.20 内容样式

content是内容样式,14号字体,25px行高,遇到<P>段落标签会自动首行缩进两个字符,如果换行就用<br>。重点显示就用<strong></strong>便签。切目前主流的门户网站,如:腾讯、网易、新浪等资讯详情页采用的都是这个效果。简单、优雅、规范。

再次强烈建议采用最源生的html标签进行手动格式化,抛弃像word那样的后台编辑器,因为它会产生非常多的冗余代码。做过编辑的朋友都知道,如过用cms系统后台自带的编辑器进行可视化编辑是件很辛苦的事。经常把格式搞的一团糟,各种标签如font、内链的style样式一坨一坨的。标签也很容易嵌套出错,或者无法闭合。更重要的一点是冗余的代码增加服务器的负载,影响网页加载速度,很多人可能不在乎这些,那是因为你的网站访问量还没有达到一定的数量级。对于一个访问量千万级的,上亿级别的网站,每节省几个字节都意味着节约更多的带宽,省掉大把的银子。

如果是从网络上转载文章的编辑,最好将文章先拷贝到记事本去除下格式,然后再进行手动添加标签进行格式化。

说到这里肯定会有一些小编喷我了,搞代码那是工程师的事,让我们搞代码,有没有搞错。如果你不会写html编码,那只能说明你还不是个专业的编辑,专业编辑就应该具备一定的html手写编码能力。

切忌使用过多的修饰,华而不实,很山寨,很雷人。

HTML SCSS CSS
<div class="hui-article-content">
  <p class="indent">content是内容样式,14号字体,25px行高,遇到&lt;P&gt;段落标签会自动首行缩进两个字符,如果换行就用&lt;br&gt;。<strong>重点显示就用</strong>&lt;strong&gt;&lt;/strong&gt;便签。切目前主流的门户网站,如:腾讯、网易、新浪等资讯详情页采用的都是这个效果。简单、优雅、规范。</p>
  <p class="indent">再次强烈建议采用最源生的html标签进行手动格式化,抛弃像word那样的后台编辑器,因为它会产生非常多的冗余代码。做过编辑的朋友都知道,如过用cms系统后台自带的编辑器进行可视化编辑是件很辛苦的事。经常把格式搞的一团糟,各种标签如font、内链的style样式一坨一坨的。标签也很容易嵌套出错,或者无法闭合。更重要的一点是冗余的代码增加服务器的负载,影响网页加载速度,很多人可能不在乎这些,那是因为你的网站访问量还没有达到一定的数量级。对于一个访问量千万级的,上亿级别的网站,每节省几个字节都意味着节约更多的带宽,省掉大把的银子。</p>
  <p class="indent">如果是从网络上转载文章的编辑,最好将文章先拷贝到记事本去除下格式,然后再进行手动添加标签进行格式化。</p>
  <p class="indent">说到这里肯定会有一些小编喷我了,搞代码那是工程师的事,让我们搞代码,有没有搞错。如果你不会写html编码,那只能说明你还不是个专业的编辑,专业编辑就应该具备一定的html手写编码能力。</p>
  <p class="indent"><strong>切忌使用过多的修饰,华而不实,很山寨,很雷人。</strong></p>
</div>
.hui-article-content {
  position: relative;
  font-size: 17px;
  line-height: 1.8;
  overflow: hidden;
  text-align: left;
  word-break: break-all;
  word-wrap: break-word;
  h3 {
    font-size: 18px;
  }
  h4 {
    font-size: 16px;
  }
  p {
    margin-bottom: 1.5rem;
    text-align: justify;
    word-break: break-all;
    &.text-c {
      text-align: center;
    }
  }
  img {
    max-width: 100%;
  }
  ul {
    text-indent: 2em;
  }
  .indent {
    text-indent: 2em;
  }
}

@media (max-width: 767px) {
  .hui-article-content {
    .content {
      font-size: 16px
    }
  }
}

@media (max-width: 480px) {
  .hui-article-content {
    .content img {
      max-width: 100%!important;
      height: auto!important;
    }
  }
}
.hui-article-content {
  position: relative;
  font-size: 17px;
  line-height: 1.8;
  overflow: hidden;
  text-align: left;
  word-break: break-all;
  word-wrap: break-word;
}
.hui-article-content h3 {
  font-size: 18px;
}
.hui-article-content h4 {
  font-size: 16px;
}
.hui-article-content p {
  margin-bottom: 1.5rem;
  text-align: justify;
  word-break: break-all;
}
.hui-article-content p.text-c {
  text-align: center;
}
.hui-article-content img {
  max-width: 100%;
}
.hui-article-content ul {
  text-indent: 2em;
}
.hui-article-content .indent {
  text-indent: 2em;
}

@media (max-width: 767px) {
  .hui-article-content .content {
    font-size: 16px;
  }
}
@media (max-width: 480px) {
  .hui-article-content .content img {
    max-width: 100% !important;
    height: auto !important;
  }
}

3.1.21 描述

H-ui
轻量级前端框架,完全免费!
描述
水平状态的描述
HTML SCSS CSS
<dl class="dl-horizontal clearfix"><dt>H-ui</dt><dd>轻量级前端框架,完全免费!</dd></dl>

.dl-horizontal 水平描述,默认不加为垂直模式。

.dl-horizontal {
  dt {
    float: left;
    width: 160px;
    overflow: hidden;
    clear: left;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  dd {
    margin-left: 180px;
  }
}
.dl-horizontal dt {
  float: left;
  width: 160px;
  overflow: hidden;
  clear: left;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-horizontal dd {
  margin-left: 180px;
}

3.1.22 隐藏 显示

CSS
.hide {
  display: none;
}

[hidden] {
  display: none;
}

.hidden {
  display: none !important;
  visibility: hidden !important;
}

.f-hide {
  font: 0/0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}

[class*=span].hide,
.hui-row-fluid [class*=span].hide {
  display: none;
}

.show {
  display: block;
}

.invisible {
  visibility: hidden;
}

3.1.23 尺寸

新增尺寸全局类名,用于表单、按钮、表格、头像、标签等元素上,要与元素一起配合使用,方能看到效果。

PS:它使用起来很简单,就像我们衣服的SIZE,是一个通用单位。不管是上衣、裤子、还是内裤都可使用。

class="" 描述
size-MINI 迷你
size-S
size-M 中 (默认尺寸,可以不写,可以理解为:均码)
size-L 稍大
size-XL
size-XXL 加大
size-XXXL 超大

举例说明

class="" 表单 下拉框 按钮 头像
size-MINI
size-S
size-M
size-L
size-XL
size-XXL      
size-XXXL