个人cssl技巧小结

1设背景图的时候,直接用img/不用background------可以使放大缩小都不变背景的大小
body{
background: url("../img/comm/login_bg.jpg")  no-repeat;
background-size:100% 100%;
}
html{
height:100%;
}


2居中
.model_center{
  position: fixed;
  top:50%;
  left:50%;
  transform: translate(-50%,-50%);
}
.absolute_center {
  margin: auto;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
}
4布局问题
4.1IE8不支持bootstrap中栅格布局
4.2为防止不同浏览器width显示不同的问题,设置主模块时width/max-width/min-width定死用px
4.3要全屏显示可获取浏览器窗口的width/height
//获取窗口高度
    var window_height=$(document).height();
//获取头部高度
     header_height=$('#header nav.navbar').innerHeight();
4.4上左右结构
header{
height:90px;
}
sidebar{
position: absolute;
top:90px;
left:0;
z-index:999;
width: 280px;
padding: 0;
}
section{
position: absolute;
top:90px;
left:0;
padding-left: 280px;
width: 100%;
}
4.5左右等高布局
#container{
overflow:hidden;
}
* html #container{
height:1%; /* So IE plays nice */
}
#left{
width:100%;
border-right:420px solid #fff;
margin-right:-420px;
float:left;
}
#right{
width:420px;
float:left;
margin-right:-420px;
}
5解决文本域下标问题 
textarea {
  resize : none;
}
6解决ieoutline问题
outline:none
7滚动条:父元素设高,overflow:auto 
8ie不支持clearfix,自己写清除float
.clearfloat:after{ 
            content: '';
            display: block;
            clear: both;
        }
9解决 外边距溢出
.clearMargin:before{
content:"";
display:table;
}
10重写easyui中window头部兼容问题filter
11文本溢出显示。。。
display:block;            /*内联对象需加*/
word-break:keep-all;      /* 不换行 */
white-space:nowrap;       /* 不换行 */
overflow:hidden;          /* 内容超出宽度时隐藏超出部分的内容 */
text-overflow:ellipsis;   /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/


/*对于表格,定义有所不同:*/  
/*@author zhenyuya <zhenyuya@163.com>*/  
table{  
    width:30px;  
    table-layout:fixed;      /* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */  
}  
td{  
    width:100%;  
    word-break:keep-all;     /* 不换行 */  
    white-space:nowrap;      /* 不换行 */  
    overflow:hidden;         /* 内容超出宽度时隐藏超出部分的内容 */  
    text-overflow:ellipsis;  /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/  
}  
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值