Scaling website content
Author
Discussion

arej

Original Poster:

425 posts

226 months

Thursday 4th March 2010
quotequote all
I am writing a website to display some photos. Is there some kind of code that I can use to scale the content of the page to take up a set percentage of the screen area so that it takes up the same screen space no matter what resolution the person is using?

Cheers

Mr Will

13,719 posts

230 months

Thursday 4th March 2010
quotequote all
<div style="width:75%"> </div>

But (in case this is what you are planning) it won't scale pictures particularly well, you will lose quality if you display them at anything other than 100%


S13_Alan

1,387 posts

267 months

Thursday 4th March 2010
quotequote all
If you want the same layout regardless of the users resolution surely you want to make the page a fixed width... so you would have typically a container div with a set width in pixels around all the stuff on the page you want to keep the same.

arej

Original Poster:

425 posts

226 months

Thursday 4th March 2010
quotequote all
It is not working! The width:75% thing just seems to move the alignment left and right but nothing to do with scaling.
Also I don't want it to be a fixed width as I want it to be smaller on smaller resolution screens and larger on larger...if that makes sense?!

This picture hopefully will help explain!

The outer box in all 3 pictures is the screen resolution so on the left is a larger resolution than those 2 on the right.
The inner box is the content, so it fits on the larger screen but on the smaller one, what is happening at the moment is the bottom right one, it is centred properly but I can't see the bottom of the box. What I'd like is like the top right one - is that possible?

I hope that makes sense!

Thanks so far.

miniman

29,465 posts

286 months

Thursday 4th March 2010
quotequote all
You asking for a fluid layout. It can be done with CSS but I wouldn't bother, most sites just won't scale properly, particularly when images are involved.