1 2 3 4 5 test1 6 7 #container { 8 background-color: #f1f1f1; 9 width: 80%;10 margin: 20px auto;11 }12 .item {13 float: left;14 color: white;15 text-shadow:0 1px black;16 margin: 10px 20px;17 padding: 20px;18 }19 #container > .item:nth-child(1) {20 background-color: #F00080;21 }22 #container > .item:nth-child(2) {23 background-color: #D8AAD8;24 }25 #container > .item:nth-child(3) {26 background-color: #A2aa5A;27 }28 #container > .item:nth-child(4) {29 background-color: #63B8FF;30 }31 32 33 3435
36 No.137
查看更多关于CSS关于子元素设置了float属性后父元素高度为0的解释和解决方法_html/css_WEB-IT的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did108979
CSS关于子元素设置了float属性后父元素高度为0的解释和解决方法_html/css_WEB-IT
阅读:40次