您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

css父标签中的子标签默认位置详细介绍

2026/1/29 13:28:03发布20次查看
这篇文章分享css父标签中的子标签默认位置详细介绍
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <style> .a{ width: 100px; height: 100px; background: red; position: relative; top: 40px; left: 50px; padding: 30px; } .b{ width: 50px; height: 50px; background: bisque; position: absolute; } </style> </head> <body> <p class="a"> <p class="b"></p> </p> </body> </html>
如果不给b标签设定top和left。他们会有个默认的值。
top和left会以width和height为基础进行定位。
以上就是css父标签中的子标签默认位置详细介绍的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product