老师,为什么我这里相邻的两元素外边距不会重叠呢?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title ></ title > < style type = "text/css" > * { padding: 0; margin: 0; } .container { width: 900px; height: 600px; background-color: white; margin: 0 auto; } .top { width: 900px; height: 350px; background: #63B8FF; } .img1 { width: 360px; height: 214px; background: url(http://img1.sycdn.imooc.com/climg//58c0f808000129a303600215.jpg) no-repeat; margin: 68px 60px; } .img2 { width: 360px; height: 214px; background: url(http://img1.sycdn.imooc.com/climg//58c0f819000198a703600214.jpg) no-repeat; margin: 68px 60px; } .top div { display: inline-block; } .bottom { width: 900px; height: 250px; background: #CD919E; } </ style > </ head > < body > < div class = "container" > < div class = "top" > < div class = "img1" > </ div > < div class = "img2" ></ div > </ div > < div class = "bottom" > < div class = "one" ></ div > < div class = "two" ></ div > < div class = "three" ></ div > </ div > </ div > </ body > </ html > |
0
收起
正在回答 回答被采纳积分+1
2回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧