Home  >  Article  >  Web Front-end  >  How to adapt DIV display to different resolutions? _html/css_WEB-ITnose

How to adapt DIV display to different resolutions? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:26:321455browse

I recently worked on a website project, but the display is different at different resolutions. The display is misaligned at high resolutions. I wonder if there is any way to make the display of DIV display the same effect at different resolutions. Yeah, can any hero give me some advice? I'd be very grateful!


Reply to the discussion (solution)

Same effect~~~
This requirement is too vague

Generally all relative positioning and percentage values ​​are used Control
The only thing that needs precise control is the external container

My current DIV has been displayed like this
#schoolnews-04 {
position:absolute;
top:278px ;
width:242px;
height:45px;
}

#schoolnews-05 {
position:absolute;
left:372px;
top:278px ;
width:396px;
height:87px;
}
How should I change it?

You can try to use responsive layout

Relative positioning percentage would be better

Percent size
media query
js calculation

They should be able to meet the requirements

Percentage. Or use screenwidth screenheight to get the resolution and set the corresponding div height and width. If there is any misalignment, it may be that the css is not set

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