天天看點

html中解決父級邊框塌陷的方法,CSS父級div邊框和高度塌陷

擁有父級div和3個子div。隻知道child2的高度。希望child1和child3具有與降低高度相同的高度。父母的邊界也在崩潰。希望父母的邊界在孩子周圍可見。 已粘貼代碼http://jsfiddle.net/586Cr/CSS父級div邊框和高度塌陷

提供了下面的代碼。

#parentt{

background-color:#000000;

border:4px solid #0000FF;

}

#child1{

background-color:#000000;

border:4px solid #FF0000;

float:left;

width:25%;

}

#child2{

background-color:#000000;

border:4px solid #FF0000;

float:left;

width:30%;

height:100px;

}

#child3{

background-color:#000000;

border:4px solid #FF0000;

width:25%;

float:left;

}

.trans60 {

zoom: 1;

filter: alpha(opacity=60);

opacity: 0.6;

}

.trans100 {

zoom: 1;

filter: alpha(opacity=100);

opacity: 1.0;

}

child1 child2 child3

2013-11-15

Arav

+0

我想op得到的答案比這個! –