I wish to set an array of text boxes using float: left in css and breaking the float at the end of each row. I want to ensure that the boxes have the same height and have been trying to use the <selector> { height: x%; }
- which works well with width property, but using % does not seem to work for height without setting a specific number like <selector> { height: ypx; }
.
Please see the example below to illustrate the problem.
h1, p {
font-size: 1em;
font-weight: normal;
display:block;
border: 1px solid black;
width: 10%;
padding : 2%;
margin:1%;
float:left;
}
h1 {
height: 40px;
}
p {
height: 100%;
}
br {
clear: both;
}
<h1> Test 1 </h1>
<h1> Test 2 </h1>
<br>
<h1> Test 3 </h1>
<h1> Test 4 </h1>
<br>
<p> Test 5</p>
<p> Test 6</p>
` has no frame of reference to apply that percentage to, it does nothing. Can you explain what you're trying to achieve with `height: 100%`? 100% *of what*?
– Tyler Roper Aug 26 '19 at 01:37not considered to be a child of
or the tag ?
– Graham Heap Aug 26 '19 at 04:27