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!
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