此方法仅对于一般位于顶端的导航条有效。 首先找到导航栏的CSS,修改其属性如下:
position: fixed; /*生成绝对定位的元素,相对于浏览器窗口进行定位*/
z-index: 99; /*设置元素的堆叠顺序,使该层处于最顶层*/ 这样修改完你会发现:导航栏向左偏移了,右侧没有背景,排版很难看。但是只要改动宽度,如下:
width: 100%;
现在还有一个问题:网站整体上移了一个导航栏的宽度。只要给下面整个层加上 padding-top 属性就好了,不在意的可以忽略这一步。 最后如果觉得不透明有点别扭,也可以来实现半透明,同样添加CSS属性如下:
filter:alpha(opacity=50); /*兼容IE6*/ -moz-opacity:0.5; /*兼容一些老版本的Mozilla浏览器*/ -khtml-opacity: 0.5; /*兼容一些老版本的Safari浏览器*/ opacity: 0.5; /*CSS标准,支持目前所有浏览器*/
802936 482464How a lot of an appealing guide, keep on producing much better half 388208
2018年8月19日 07:44347521 911302I admire the helpful facts you offer inside your articles. I will bookmark your weblog and also have my children verify up here often. Im really sure theyll learn a great deal of new issues proper here than anybody else! 217602
2018年8月14日 04:24