工作工具之--CSS封装

本文主要介绍了在工作中如何进行CSS的封装,包括function模块,针对PC端的pc-reset重置样式,以及针对移动端的phone-reset重置样式。
摘要由CSDN通过智能技术生成

function

/* 禁止选中文本 */
.usn{
   
    -webkit-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    -o-user-select:none;
    user-select:none;
}
/* 浮动 */
.fl {
    float: left; }
.fr {
    float: right; }
.cf {
    zoom: 1; }
.cf:after {
   
    content:".";
    display:block;
    clear:both;
    visibility:hidden;
    height:0;
    overflow:hidden;
}

/* 元素类型 */
.db {
    display: block; }
.dn {
    display: none; }
.di {
    display: inline }
.dib {
   display: inline-block;}
.transparent {
    opacity: 0 }


/*文字排版、颜色*/
.f12 {
    font-size:12px }
.f14 {
    font-size:14px }
.f16 {
    font-size:16px }
.f18 {
    font-size:18px }
.f20 {
    font-size:20px }
.fb {
    font-weight:bold }
.fn {
    font-weight:normal }
.t2 {
    text-indent:2em }
.red,a.red {
    color:#cc0031 }
.darkblue,a.darkblue {
    color:#039 }
.gray,a.gray {
    color:#878787 }
.lh150 {
    line-height:150% }
.lh180 {
    line-height:180% }
.lh200 {
    line-height:200% }
.unl {
    text-decoration:underline; }
.no_unl {
    text-decoration:none; }
.tl {
    text-align: left; }
.tc {
    text-align: center; }
.tr {
    text-align: right; }
.tj {
    text-align: justify; text-justify: inter-ideograph; }
.wn {
    /* 强制不换行 */
    word-wrap:normal;
    white-space:nowrap;
}
.wb {
    /* 强制换行 */
    white-space:normal;
    word-wrap:break-word;
    word-break:break-all;
}
.wp {
    /* 保持空白序列*/
    overflow:hidden;text-align:left;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;
}
.wes {
    /* 多出部分用省略号表示 , 用于一行 */
    overflow:hidden;
    word-wrap:normal;
    white-space:nowrap;
    text-overflow:ellipsis;
}
.wes-2 {
    /* 适用于webkit内核和移动端 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
} 
.wes-3 {
   
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值