Home > Web Front-end > HTML Tutorial > CSS-How to align objects within a div below? _html/css_WEB-ITnose

CSS-How to align objects within a div below? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:06
Original
919 people have browsed it

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>
Copy after login


Reply to discussion (solution)

It seems that only absolute positioning can be used


dd

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template