Fane
Fane

Reputation: 2076

Maintain website layout during resize (resize all elements at the same time with javascript?)

My layout is a mess. It works just fine given a certain resolution and I've decided to spread this same layout vertically on mobile clients to avoid further complications. The problem comes when resizing the desktop client. Not every element takes part on shrinking / expanding and the whole website stays desfigurated. I've tried keeping it all via '%' in width and height but does not work as it should anyway

Is there any library that expands and shrinks every element on resize? Keeping harmony between width, height, font-size, whatever. I hardly believe no one has ever developed such a thing like this... Tyvm for your help...

Upvotes: 0

Views: 433

Answers (3)

Ole Lasse Bjellaas
Ole Lasse Bjellaas

Reputation: 33

To keep everything in the same proporsion when resizing a webpage I always use either % og em/rem.

ex:

width: 100%;

or:

width: 45em;

This way, when users change the zom, the design keeps itself in the same proporsion.

Upvotes: 0

MrEhawk82
MrEhawk82

Reputation: 819

Using media queries in your CSS file will help better.
http://www.w3.org/TR/css3-mediaqueries/

Upvotes: 1

Giannis Tzagarakis
Giannis Tzagarakis

Reputation: 530

why dont you use css so you can use relative layout?

Upvotes: 1

Related Questions