绝对定位无法撑开相对定位

xiaoxiao2021-02-28  134

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> *{ margin: 0; padding: 0; } .div1{ position: relative; border: 10px solid yellow; } .div2{ width: 100px; height: 100px; background: red; position: absolute; } </style> </head> <body> <div class="div1"> <div class="div2"></div> </div> </body> </html>

为什么呢?

转载请注明原文地址: https://www.6miu.com/read-32180.html

最新回复(0)