前端备忘录
设置行内: display:inline-block;*zoom:1;*display:inline;
空格:
点线:dotted 虚线:dashed
单行省略号: .test {width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
文字间距: letter-spacing:
背景图片自适应: background-size:15px auto; background-size:100% auto;
背景图片滚动方式: background-attachment:scroll | fixed;
透明: .btn01:hover {filter:alpha(opacity=80);-moz-opacity:0.8;-khtml-opacity:0.8;opacity:0.8;}
清除浮动: .clearfix:after {clear: both;content: ".";display: block;height: 0;visibility: hidden;} .clearfix { *zoom:1; }
事件穿透: pointer-events:none;
//合并单元格
跨行合并:rowspan 如:rowspan = "2" 跨列合并:colspan 如:colspan = "3"
//多行省略
$(".chanpin_item .text .info-box").each(function(i){
var divH = $(this).height();
var $p = $("p", $(this)).eq(0);
while ($p.outerHeight() > divH) {
$p.text($p.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "..."));
};
});
//hack
width:100px; /*一般浏览器*/
width:200px\9; /*IE8*/
*width:150px; /*IE7*/
_width:50px; /*IE6*/
@-moz-document url-prefix() {.fee_box.ref .bank_select_bar { top: 8px; }}/*火狐*/
@media screen and (-webkit-min-device-pixel-ratio:0){ }/*谷歌*/
//手机端
$('html').css('font-size':$(window).width()/20+'px');
body:{font: normal 62.5% tahoma,arial,"Microsoft YaHei",SimSun,sans-serif;}
font-family: "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
水平居中:display:inline-block;text-align:center;
垂直居中:vertical-align: middle; 或 height = 30px; line-height = 30px;
水平垂直居中: top: 50%;left: 50%;-webkit-transform: translate(-50%, -50%);