I recently designed a responsive webpage with two distinct sections. In order to ensure all elements in the right section were responsive, I utilized the following CSS code:
#rightSection * {max-width:100%; height:auto;}
Despite this, I noticed that any additional styling related to height was not taking effect, as evident in the code snippet.
Avoiding the use of !important
is important for me due to the presence of numerous inline styles within the HTML code. So, I am seeking an alternative method to establish heights subsequent to using height:auto
.
#rightSection * {max-width:100%;height:auto;}
.mydiv {
width:534px;
height:37px;
box-sizing:border-box;
}
<div id="rightSection">
<div class="mydiv" style="background:#ff0000"></div>
</div>
The red div remains invisible due to the ignored height property!