Home >Web Front-end >HTML Tutorial >CSS-How to align objects within a div below? _html/css_WEB-ITnose
In a div with a height of 30, the height of the objects placed inside is 25. I hope to set it in the outer div so that the objects inside are aligned. However, after setting padding-top, the outer div is stretched open and the inner objects are It is OK to set margin-top:5px, but it is uncertain what and how many things should be placed inside, so I do not want to set it in the internal object.
<div style="height:30px;width:100%;border:1px solid red;vertical-align:bottom;padding-top:5px"><div style="height:25px;border:1px solid green">dd</div> </div>
It seems that only absolute positioning can be used
8f362ebc50d2d172ff978da99e339489
58ffc650a7c30a56863ff9e825d30592dd16b28748ea4df4d9c2150843fecfba68
16b28748ea4df4d9c2150843fecfba68