Skip to content

Instantly share code, notes, and snippets.

@black-black-cat
Created March 14, 2016 12:15
Show Gist options
  • Select an option

  • Save black-black-cat/394bcaede8faf34f6b3b to your computer and use it in GitHub Desktop.

Select an option

Save black-black-cat/394bcaede8faf34f6b3b to your computer and use it in GitHub Desktop.
常用的css类
/* 清除浮动 */
.fix{*zoom:1;}
.fix:after{display:table; content:''; clear:both;}
/* 单行文字溢出虚点显示,前提是文本长度大于容器的宽度 */
/*记忆要点元素溢出、文本溢出、不换行*/
.ell{text-overflow:ellipsis; white-space: nowrap; overflow: hidden;}
/* 块状元素水平居中 */
.auto{margin-left:auto; margin-right:auto;}
/* 基于display:table-cell的自适应布局 */
.cell{display:table-cell; *display:inline-block; width:2000px; *width:auto;}
/* 双栏自适应cell部分连续英文字符换行 */
.cell2{overflow:hidden; _display:inline-block;}
/* css3过渡动画效果 */
.trans{
-webkit-transition:all .3s;
transition:all .3s;
}
/* 大小不定元素垂直居中 */
.dib_vm{display:inline-block; width:0; height:100%; vertical-align:middle;}
/* 加载中背景图片 其中url需要自定义 */
.loading{background:url(about:blank) no-repeat center;}
/* 无框文本框文本域 */
.bd_none{border:0; outline:none;}
/* 绝对定位隐藏 */
.abs_out{position:absolute; left:-999em; top:-999em;}
.abs_clip{position:absolute; clip:rect(0 0 0 0);}
/* 按钮禁用 */
.disabled{outline:0 none; cursor:default!important; opacity:.4; filer:alpha(opacity=40); pointer-events:none;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment