Home  >  Article  >  Web Front-end  >  God comes in! I'm a newbie! I have a question about adaptive web page DIV_html/css_WEB-ITnose

God comes in! I'm a newbie! I have a question about adaptive web page DIV_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:12:041011browse

This is how I think about it, there are several small DIVs inside a large DIV. If I want one of the small DIVs to be aligned to the far right,

But the premise is the width of the parent DIV. It is AUTO, and the width of the child DIV cannot be fixed.

And the parent DIV can be aligned on the rightmost side to achieve different resolutions. Please tell me how to achieve it.

The most important premise is that it cannot be fixed. The length of the DIV, thank you.

Of course, it is ultimately necessary to generate a frame similar to a specific width. This is the key, and the adaptability is better than a fixed-length DIV collection.


Reply to discussion (solution)

margin-right:5px;

Set parent div to position:relative
child The div is position:absolute; right:0; top:0;

Just set margin-right for the div you want to align to the right.

child div is position:absolute; right:0; top:0;

Thank you everyone, I will try it. If you do, you’ll get points

Statement:
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