CSS 定位-固定定位
最编程
2024-07-18 12:17:37
...
元素的位置相对于浏览器窗口是固定位置。
即使窗口是滚动的它也不会移动:
<title>(runoob.com)</title>
<style>
p.pos_fixed
{
position:fixed;
top:30px;
right:5px;
}
</style>
</head>
<body>
<p class="pos_fixed">Some more text</p>
<p><b>注意:</b> IE7 和 IE8 支持只有一个 !DOCTYPE 指定固定值.</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>
注意: Fixed 定位在 IE7 和 IE8 下需要描述 !DOCTYPE 才能支持。
Fixed定位使元素的位置与文档流无关,因此不占据空间。
Fixed定位的元素和其他元素重叠。
上一篇: [说站] css 位置中的四个常用属性值
下一篇: nio 缓冲区的容量、位置和限制。
推荐阅读
-
使用 Dlib 库进行人脸检测和关键点定位
-
jquery 实现点击菜单实现高德地图定位点与数据显示联动效果
-
vue-scroll 实现页面组件锚点定位 - 后台
-
SAP HCM 薪资核算红色异常日志消息如何快速定位问题
-
使用 xpath 在 HTML 中精确定位元素的基本方法
-
MATLAB 下的 RSSI 定位程序,在基站数量可调的二维平面上进行定位--简介
-
遇到SQL速度慢时如何定位问题,SQL错误报告 | OceanBase优化实践
-
[操作系统] III.内存管理: 2. 虚拟内存管理(虚拟内存:定位原理、请求分页管理、页面替换算法)
-
2015 年 "高教杯 "全国竞赛数学建模第 A 题日影定位解完整文档及流程 - 第 A 题日影定位
-
爬虫]PlayWright 说明 - 三、调试和定位元素