CSS+DIV固定顶部导航代码-不跟随页面滚动,附源文件,经典收藏

阅读更多

固定顶部导航,不跟随滚动,固定页面顶部纯div+css;

以下代码经测试兼容IE6 7 8 9 google firefox

HTML代码:





固定顶部导航代码-不跟随滚动































































































































 

CSS代码:

 /*  
  @Description:中国网河南频道  
  @Author:    liujinghao  
  @Update:       
 */ 

/*CSS重构*/
body{ font-size:12px; color:#656565; background:#FFF;}
body {background: url(about:blank); background-attachment: fixed;}
*{ margin:0; padding:0; border:0}
.clear{ clear:both; font-size:1px; line-height:1px;}
input,select{font-size:12px;line-height:16px;}
input{ border:#006 1px solid; height:18px;}
ul,li{list-style-type:none; list-style:none;}
a{ text-decoration:none; font-size:14px; font-family:"宋体";  color:#004276}
a:hover{ color:#F00; text-decoration:underline}
span{  color:#004276}
.red{ color:#F00}
.red a{ color:#F00}
em{ font-style:normal}

.topdiv{ width:100%; height:40px; overflow:hidden; background:url(../images/top-bg.png) repeat-x ; filter:alpha(opacity=90); -moz-opacity:0.90; opacity:0.90;}
.top{ width:1000px; height:42px; margin:auto;}
.topdiv { top:0; position:fixed; background-color: #C30; _position:absolute;z-index:999;
        _top:expression(documentElement.scrollTop);}
b{ font-weight:normal; }
.top-logo{ height:30px; width:63px; float:left; background:url(../images/top-logo.png) left center no-repeat; margin-top:1px; }
.top-logo a{ height:30px; width:63px; float:left; display:block;}
.topnav{  height:34px; float:left;}
.topnav span a{ font-size:14px; color:#666; line-height:34px;}
.topnav span a:hover{ color:#F00}
.zhuce{ width:130px; height:30px;float:right; }
.zhuce span{ float:right}
.zhuce span a{font-size:14px; color:#666; line-height:34px;}
.zhuce span a:hover{ color:#F00;}

 

  • 固定顶部导航代码-不跟随滚动.zip (554.4 KB)
  • 下载次数: 124

你可能感兴趣的:(固定顶部导航,不跟随滚动,固定页面顶部)