css position fixed 左右双定位的实现代码
程序员文章站
2022-06-27 09:22:13
css position(定位)position 属性指定了元素的定位类型。position 属性的五个值: static relative fixed absolute...
css position(定位)
position 属性指定了元素的定位类型。
position 属性的五个值:
- static
- relative
- fixed
- absolute
- sticky
元素可以使用的顶部,底部,左侧和右侧属性定位。然而,这些属性无法工作,除非是先设定position属性。他们也有不同的工作方式,这取决于定位方法。
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <style> .box{ width: 1400px; height: 1500px; margin: 0 auto; } .box1{ border: 1px solid #000000; height: 200px; width: 200px; display: inline-block; position: fixed; } .box02{ border: 1px solid #006400; height: 1500px; width: 800px; display: inline-block; margin: 0 20px; margin-left: 250px; } .box03{ border: 1px solid #006400; height: 200px; width: 200px; display: inline-block; position: fixed; } </style> </head> <body> <div class="box"> <div class="box1">123</div> <div class="box02">456</div> <div class="box03">789</div> </div> </body> </html>
到此这篇关于css position fixed 左右双定位的实现代码的文章就介绍到这了,更多相关css position fixed定位内容请搜索以前的文章或继续浏览下面的相关文章,希望大家以后多多支持!
推荐阅读
-
基于Fixed定位的框选功能的实现代码
-
纯CSS实现DIV悬浮的示例代码(固定位置)
-
固定定位position:fixed实现高度自适应的教程
-
css position fixed 左右双定位的实现代码
-
纯CSS实现上下左右都居中的代码
-
IE下的纯CSS完美position:fixed实现方案
-
IE下的纯CSS完美position:fixed实现方案
-
关于div定位position:fixed的一点问题_html/css_WEB-ITnose
-
css的position定位属性中:absolute与fixed的区别
-
position:fixed定位时 “高度坍塌” 问题的解决_html/css_WEB-ITnose