块级元素的上下边距

xiaoxiao2021-02-28  74

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <style>         /*水平排列的盒子 间距是margin相加。垂直排列的盒子是取最大值*/         #div1{             height: 100px;             background-color: red;             margin-bottom: 20px;         }         #div2{             height: 100px;             background-color:brown;             margin-top: 30px;         }     </style>     <title>块级元素的上下边距</title> </head> <body> <div id="div1">杰瑞教育1</div> <div id="div2">杰瑞教育2</div> </body> </html>
转载请注明原文地址: https://www.6miu.com/read-71410.html

最新回复(0)