4

I need to make my web page un-zoomable such that the divs don't collide each other or overlap each other. The stackoverflow site is a great example. In a case where the user zooms in the web page, the divs should be in their original positions.

enter image description here

When Zoomed, it's still fixed.

When Zoomed

What changes do I need to make to the CSS files?

Dinuka Jay
  • 4,583
  • 6
  • 63
  • 132

3 Answers3

1

You must be giving width in px. You should do it in percentage if you want your layout to stay right when you zoom in or zoom out

user786
  • 3,502
  • 3
  • 28
  • 56
1

On your containing elements, declare an specific width.

If you look at Stack Overflows following css, you can see that they set a width on their content block.

#content {
    width: 1000px;
}

The child elements within #content also have absolute widths set

#mainbar {
    width: 728px;
}
#sidebar {
    width: 220px;
}

I hope this helps.

Joshua Kelly
  • 893
  • 7
  • 12
0
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'/>

this should work

Ramy Hadid
  • 24
  • 3