henuyuxiang

设置父级div为相对位置

设置子级div为绝对位置

代码如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
        <div style="width: 100%; height: 600px; border: 1px solid; position:relative">
            <div style="width: 200px; height: 100px; border:1px solid; position: absolute; top: 30px; left: 60px;"></div>
        </div>
    </body>
</html>

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-04
  • 2021-12-03
  • 2021-10-06
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案