I am trying to resolve the avoid large layout shifts in PagespeedInsights The solution is to set with and height of the below div element.
<div id="HomeNewsEventsWrapper" class="section fixedheight1 introduction table">
@media (min-width:0px) and (max-width:580px) {
#HomeNewsEventsWrapper{
}
}
However, It will also affect the media queries(If the viewport is greater than 580px in real life)
Also, how can I set with and height for every viewport?
I also tries setting height and width to auto but it does not work.
First step Set a fixed height and width for the element in css file , Adjust the height and width for smaller viewports