I
I
Igor2016-06-20 17:12:33
css
Igor, 2016-06-20 17:12:33

How to scale website page sizes with css?

Now the objects on my site look like this:
c05dc62af5aa4ee8af06aabf036feed5.png
And I need to do something like this, without affecting the user's browser settings, reduce the size of the site's pages:
c25e788b958c4bd0a753afffaf4b45a7.png
How can I do this quickly and painlessly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Fedorov, 2016-06-20
@grishin-korolev

html {
  transform: scale(.9, .9);
}

M
Mr Crabbz, 2016-06-20
@Punkie

Do:

html {
font-size: 62.5%;     // - равно 10px
}

Next, we distill all px into rem according to the formula: 10 px = 1 rem.
That is, where padding-left: 340px -> padding-left: 34rem
When everything is moved to rem - just in the html selector we change the font-size to 50% for example. Whatever was given in rem will decrease by 62.5% - 50% = 12.5%. Proportional and without any blurs.
Only < img > have rigid width and height removed in the html code. Or specify sizes for them in css (again in rem).
Yes - not the fastest way. But the coolest. Plus you can mod media queries to gradually scale the layout. For example, with a 320x screen - make font-size: 25% in general.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question