css - fixed定位(设置固定的导航条)
2016-11-27 23:03
344 查看
元素的位置相对于浏览器窗口是固定位置。
即使窗口是滚动的它也不会移动:
实例
注意: Fixed 定位在 IE7 和 IE8 下需要描述 !DOCTYPE 才能支持.
Fixed定位使元素的位置与文档流无关,因此不占据空间。
Fixed定位的元素和其他元素重叠。
即使窗口是滚动的它也不会移动:
实例
<!DOCTYPE html> <html> <head> <style> p.pos_fixed { position:fixed; top:30px; right:5px; } </style> </head> <body> <p class="pos_fixed">Some more text</p> <p><b>Note:</b> IE7 and IE8 supports the fixed value only if a !DOCTYPE is specified.</p> <p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p><p>Some text</p> </body> </html>
注意: Fixed 定位在 IE7 和 IE8 下需要描述 !DOCTYPE 才能支持.
Fixed定位使元素的位置与文档流无关,因此不占据空间。
Fixed定位的元素和其他元素重叠。
相关文章推荐
- css 绝对定位(absolute)和固定定位(fixed)
- 跨浏览器的CSS固定定位{position:fixed}
- CSS固定DIV,导航条顶部固定fixed(兼容IE6) 推荐
- 跨浏览器的CSS固定定位{position:fixed}
- CSS固定定位{position:fixed}
- 跨浏览器的CSS固定定位{position:fixed}
- css 兼容ie6,ie7,ff的fixed,元素上下端固定定位方法
- 关于CSS在浏览器中固定定位position:fixed的应用
- 跨浏览器的CSS固定定位{position:fixed}
- 跨浏览器的CSS固定定位{position:fixed}
- css 兼容ie6,ie7,ff的fixed,元素上下端固定定位方法
- 分享CSS固定DIV,导航条顶部固定fixed
- 跨浏览器的CSS固定定位{position:fixed}
- css 兼容ie6,ie7,ff的fixed,元素上下端固定定位方法
- 跨浏览器的CSS固定定位{position:fixed}
- 跨浏览器的CSS固定定位{position:fixed}
- js 设置css的定位
- 【HTML】【CSS】表格设置了table-layout:fixed后第一行合并单元格其下单元格宽度设置不起作用的解决方法
- css固定元素位置(fixed)
- IE6 position:fixed (固定定位)的解决方案