84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
The p of the child is float; how to make the height of the p of the child inherit the height of the parent
You are talking about clearing the float, just set overflow:hidden; on the parent level
The amount of information in the question is relatively small. I don’t know if this is the effect you want:
HTML:
CSS:
.parent-p { position:relative; height: 400px; width: 200px; background-color:forestgreen; } .child-p { float:left; margin-left:10px; width: 53px; height: inherit; background-color: tomato; } }
Give the height of the parent element and then set height:100% for the child element?
100% No problem
Baidu clearly floats, there are a lot of methods
You are talking about clearing the float, just set overflow:hidden; on the parent level
The amount of information in the question is relatively small. I don’t know if this is the effect you want:
HTML:
CSS:
Give the height of the parent element and then set height:100% for the child element?
100% No problem
Baidu clearly floats, there are a lot of methods