Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
HI guys
i wrote a website and its pretty amazing.
But i got a problem when my browser is maximize my website looks fantastic but when i restore down my browser size my elements moves from its real position.

thanks
Posted
Comments
Dave Kreskowiak 13-Sep-15 13:59pm    
Your question is really unanswerable. There are so many things you can do and so many different ways of doing them it's really something that should have been taken into account before you even wrote the first opening HTML tag.

We know nothing about your site, what the content is, how it was arranged on the page(s), what formatting tags were used, what the CSS looks like, does javascript and jQuery control any of this layout, ..., ..., ...

Any and all of this stuff, when configured properly, will do various things to control the layout, but what you want it to do and how you want it to look at various browser window widths and heights is entirely up to you.

1 solution

This is not "browser size", but I hope I understand what you mean.

The question is too vague to discuss anything seriously.
You can use the properties window.innerWidth and window.innerHeight:
https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth[^],
https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight[^].

From your question, I cannot be sure that you really need it. It's more likely that, instead, you need to embrace liquid, fluid or elastic design. Please see my past answers:
Webpage screen resolution (Cross Browser\Cross Platform) problem[^],
To Get Screen resolution[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900