Why does my whole site scale when I upload it to a web hosting?

When testing my site on my local computer, the proportions are correct; images and widths as I want them to be.

However, when I upload them to my web host, Dreamhost, it seems that the whole site is about 10% full (images, font sizes, sidebar width, etc.). The scaling problem occurs in Firefox, Chrome, IE7-10, Safari, but also displays correctly when viewed locally.

The code is exactly the same. I tried reloading the images and testing my code, but to no avail. I never had such a problem before ... somehow at an impasse.

enter image description here

+4
source share
3 answers

You can zoom in on your site on your local computer. when you upload it to the hosting site, it displays it by default. therefore, when web pages do not zoom in or out.

+1
source

Sometimes this happens when the CSS programmer uses em , not px . In some cases, the problem can be solved, especially in the release of the font, with the property: 100%. How:

 body{ font-size:100%; } p{ font-size:0.5em; } 


It will set 100% for all font properties, but will indicate the font size in a specific area, tag. Then 100% will result in the area tag to set the size in a certain proportion.
You can try the same (though not verified) <img> tags. Set the common property first, then set whatever you want.
I'm not sure about that, but it's just a thought. :)

0
source

To finish Mayeenul Islam , I can add that it is always better to immediately place the container after the body tag. It does not hurt and helps. So instead of formatting a 100% font correction for each css style, you could do it globally. Like this:

  <style> body { font-size:100% } #container { font-size:1em } </style> 
0
source

Source: https://habr.com/ru/post/1440380/


All Articles