【css超出部分省略号】css div固定顶部例子

更新时间:2019-10-13    来源:flex    手机版     字体:

【www.bbyears.com--flex】


有很多网站都有固定在顶部的html样式但是不知道怎么弄啊!费了很大的力气才知道这个是关键字是 html div css 固定顶部 而且这个代码还支持半透明哦! 好了这个代码支持ie和360 至于ie6 是否也支持我就不知道咯!下面就是代码了
 


固定在顶部啊

例子

 

 

 

 

CSS定义一个固定在页面顶部的层 

 

body { 

height:1200px; 

margin: 0; 

padding: 0; 

background-attachment: fixed; /* prevent screen flash in IE6 */ 

} 

div,ul{margin: 0;padding: 0;} 

#topNavWrapper { 

width: 980px; 

text-align: left; 

height: 31px; 

margin: 0px auto; 

z-index:100; 

_position: relative ; 

_top:0px; 

} 

#topNav { 

width: 980px; 

float: left; 

display: block; 

z-index: 100; 

overflow: visible; 

position: fixed; 

top: 0px; /* position fixed for IE6 */ 

_position: absolute; 

_top: expression(documentElement.scrollTop + "px"); 

background-image: url( /uploadfile/2012/0717/0717014456145_4456.gif); 

background-repeat: no-repeat; 

background-position: right; 

height: 31px; 

line-height: 31px; 

color:#fff; 

background-color:#444; 

text-align:center; 

} 

 

 

 

 

 

我是固定在页面顶部的层 

 

 

 

本文来源:http://www.bbyears.com/flash/72989.html