常用 CSS 片段

文字超出显示省略号

/*<p class=‘text-ellipsis‘></p>*/
.text-ellipsis{
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

清除浮动

/*<div class=‘clearfix‘></div>*/
.clearfix:after {
    display: block;
    content: ‘‘;
    clear: both;
    height:0;
}
/* or */
.clearfix {
   overflow: hidden;
   clear: both;
}
时间: 2024-08-29 13:28:26

常用 CSS 片段的相关文章

顶 企业站常用css横向导航菜单

<!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml</a>" lang="zh-CN"><head><m

常用css

类型 Internet Explorer Firefox Chrome Opera Safari 版本 (×)IE6 (×)Firefox 2.0 (√)Chrome 1.0.x (×)Opera 9.64 (√)Safari 3.1 (×)IE7 (√)Firefox 3.0 (√)Chrome 2.0.x     (×)IE8 (√)Firefox 3.5                 border-radius:25px;-moz-border-radius:25px; /* 老的 Fi

常用css表达式-最小宽度-上下居中

/* IE6下最小宽度的CSS表达式 */ width:100%; min-width:1024px; _width:expression((document.documentElement.clientWidth||document.body.clientWidth)<1024?"1024px":""); 模块垂直居中,兼容IE6,注意,模块的所有父辈标签不能有定位属性,不能有overflow:hidden; .duilian_right{width:90p

Android--新手必备的常用代码片段整理(二)

收集设备信息用于信息统计分析 是否有SD卡 动态隐藏软键盘 动态显示软键盘 动态显示或者是隐藏软键盘 主动回到Home后台运行 获取状态栏高度 获取状态栏高度标题栏ActionBar高度 获取MCCMNC代码 SIM卡运营商国家代码和运营商网络代码 返回移动网络运营商的名字 返回移动终端类型 判断手机连接的网络类型2G3G4G 判断当前手机的网络类型WIFI还是234G 收集设备信息,用于信息统计分析 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

!!!常用CSS代码

.box{overflow:auto;zoom:1;} .box-in{display:inline-block;vertical-align:top;} .border-box{-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;}/*ie8+*/ body,div,p,h1,h2,h3,h4,h5,h6{margin:0;padding:0;} (待补充) 清除浮动 <style

常用css字体英文写法

font-family: 'Microsoft Yahei',sans-serif; 宋体:SimSun 黑体:SimHei 常用css字体英文写法

常用Java片段

1. 字符串与整型的相互转换 String a = String.valueOf(2);   //integer to numeric string   int i = Integer.parseInt(a); //numeric string to an int  2,得到当前方法的名字 public class MethodName {     private void IamAMethod(){         String methodName = Thread.currentThrea

!!!常用CSS代码块

图片排满一行.左右两端无间隙. <style type="text/css"> .img_abc{float:left;width:30%;margin-left:5%;} .img_abc:first-child{margin-left:0} .body92{margin-left:4%;margin-right:4%;} </style> <div class="body92"> <img src="14085

discuz内置常用CSS代码分析

CSS多IE下兼容HACK写法 所有 IE浏览器适用:.ie_all .foo { ... } IE6 专用:.ie6 .foo { ... } IE7 专用:.ie7 .foo { ... } IE8 专用:.ie8 .foo { ... } CSS书写规范 属性写在一行内,属性之间.属性名和值之间以及属性与“{}”之间须有空格,例如:.class { width: 400px; height: 300px; } 属性的书写顺序: 针对特殊浏览器的属性,应写在标准属性之前,例如:-webkit