PDA

View Full Version : css layout


Zozart
27-03-2003, 13:29
Okay, I decided to have a go at a css layout, which is here > http://www.zyon.org/splatynet

But, what i'd like to know, is if its possible to set up the content box to be centered relative to the page, and have a width of around 90% ?

Any help appreciated :D

AlastairM
27-03-2003, 14:10
Add
width:90%;
margin-left:auto;
margin-right:auto;
onto your .content class

Can't remeber if this works in IE5 or IE5.5, don't think it does. It also won't work in IE6 if your document starts with:
<?xml version="1.0" encoding="iso-8859-1"?>
so just remove it, its optional anyway...

you can also do:

width:90%;
margin-left:5%;
margin-right:5%;

but since your using a border, it'll add up to 90% + 5% + 5% + border width, which will give you a horizontal scrollbar. If you drop the -left and -right percentages down a bit, then it'll work but it won't be exactly in the centre. IIRC, using percentages does work in IE5 though. Its your call.

this might also help (http://www.bluerobot.com/web/layouts/)

cheers

alastair

Zozart
27-03-2003, 14:29
Cool, thanks, the first one works the best.. and also appears to work in IE6 with or without '<?xml version="1.0" encoding="iso-8859-1"?>' ?

Is IE5 available for download anywhere? I realise alot of people still use this, so i need to test in it, but I only have IE6 here :\ ...Checked the microsoft site but can only find IE6 :(

*edit* I found it, I doubt it will install, oh well..

And after looking on the bluerobot thing, I guess it will work, since the contents container div has 'text-align: center'

ling_thing
27-03-2003, 14:54
appears to work fine in IE5

here it is

http://alasdairling.co.uk/splaty.jpg

Zozart
27-03-2003, 15:03
Cool, thanks :)