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


/* IE6下最小宽度的CSS表达式 */

width:100%; min-width:1024px; _width:expression((document.documentElement.clientWidth||document.body.clientWidth)<1024?"1024px":"");

 

模块垂直居中,兼容IE6,注意,模块的所有父辈标签不能有定位属性,不能有overflow:hidden;

.duilian_right{width:90px; height:300px; position:fixed; top:50%; left:50%; margin-top: -150px;}

.duilian_right{_position:absolute;_margin-top: auto; _top:expression(eval(document.documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2));}

或者:

.surveypop {
    border:5px solid #721e1f;
    height:520px;
    width:400px;
    margin-top:5px;
    background-color:#fff;
    position:fixed;
    left:-9999em;
    top:-9999em;
    margin-left:-210px;
    display:none;
    font:14px "Microsoft YaHei","黑体";
    color:#734925;
    z-index:990;
    background:#cecece;
}
* html .surveypop {
    position:absolute;
    top:50%;
    margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
}

 

 

posted on 2014-05-27 11:49  靖儿  阅读(297)  评论(0编辑  收藏  举报

导航