CSS position属性中absolute这个属性是干什么用的?
程序员文章站
2022-04-13 08:18:04
...
css定位参数:position、left、right、top、bottom
参数说明:
absolute参数用来指定方块的定位方式,top、bottom、left、right分别指定方块的上下左右坐标。
参数值说明。
absolute:绝对定位
fixed:固定定位
relative:相对定位
static:静态定位
示例代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>示例网页</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style> .c1{ width:200px; height:150px; line-height:75px; text-align:center; border:1px solid #909; position:absolute; top:50px; left:50px; } </style> </head> <body> <div class="c1"> 本方块宽200px,高150px,绝对定位于上边50px,左边50px </div> </body> </html>
以上就是CSS position属性中absolute这个属性是干什么用的?的详细内容,更多请关注其它相关文章!
推荐阅读
-
css的position定位属性中:absolute与fixed的区别
-
CSS position属性中的绝对定位:absolute relative
-
详解CSS中position的4种属性(fixed |absolute | relative | static )
-
CSS position属性中absolute这个属性是干什么用的?
-
css position属性中:absolute与relative的区别
-
css的position定位属性中:absolute与fixed的区别
-
详解CSS中position的4种属性(fixed |absolute | relative | static )
-
CSS position属性中的绝对定位:absolute relative
-
CSS position属性中absolute这个属性是干什么用的?
-
css position属性中:absolute与relative的区别