css基礎 嵌套的塊元素設置外邊距
阿新 • • 發佈:2018-02-11
post cast ima 技術 school cas 邊距 title hid
禮悟:
公恒學思合行悟,尊師重道存感恩。葉見尋根三返一,江河湖海同一體。
虛懷若谷良心主,願行無悔給最苦。讀書鍛煉養身心,誠勸且行且珍惜。
ide:visual studio 2017
browser:Chrome
os:win7
代碼
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="author" content="https://www.cnblogs.com/jizuiku"/> <title></title> <style type="text/css"> .father { width:200px; height:200px; background-color:crimson; margin-top:50px; } .son { width:100px; height:100px; background-color:rebeccapurple; margin-top:40px; } </style> </head> <body> <div class="father" style="overflow:hidden;"> <div class="son"> </div> </div> <hr /> <div class="father"style="border-top:1px solid crimson;"> <div class="son"> </div> </div> <hr /> <div class="father" style="padding-top:1px;"> <div class="son"> </div> </div> </body> </html>
效果
CSS3優秀,值得學習。
學習資源: www.w3cschool.cn + itcast和itheima視頻庫 + 清凈的心地。
如果您有公開的資源,可以分享給我的話,用您的資源學習也可以。
博文是觀看視頻後,融入思考寫成的。博文好,是老師講得好。博文壞,是 給最苦 沒認真。
css基礎 嵌套的塊元素設置外邊距