今天是2019年6月20日,在这里跟大家分享css基础中外边距、内边距、背景等相关属性的设置及一些问题的解决!话不多说,直接上知识点。
一、轮廓
二、按钮
三、盒子模型(框模型)
四、外边距
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>垂直外边距合并</title> <style> div { width: 300px; height: 300px; background: #008000; } #box1 { margin-bottom: 30px; } #box2 { margin-top: 20px; } </style> </head> <body> <div id="box1"></div> <div id="box2"></div> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>溢出生成</title> <style> .box, #box { width: 200px; height: 200px; background: #008000; } #box { background: #0000FF; } #box:before { content: ""; display: table; } .child { width: 80px; height: 80px; background: #E4393C; margin-top: 100px; } </style> </head> <body> <div class="box"></div> <div id="box"> <div class="child"></div> </div> </body> </html>
五、内边距
六、背景相关属性
未完,待续!等待下次更新。。。
原文:https://www.cnblogs.com/woheni/p/11060662.html