Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vertical alignment in XHTML

Status
Not open for further replies.

alexanderdring

Technical User
Dec 27, 2002
36
FR
Hi everyone,

I would like to produce a site in XHTML in which the content (a console of 760 x 420 pixels) is automatically centralised vertically and horizontally in all browsers, regardless of screen resolution. I can do this using tables in HTML without a problem, but I'm having trouble with it using XHTML/CSS, but it's a requirement of the brief since the site must be W3C valid. Does anyone have any ideas?

Thanks again,

Alex
 
This is how i would do this to make it w3c compliant (With inline style sheet you can convert these into IDs and put in head of doc). You have to use the text align centre on the body tag or containing div tag due to bug with IE browers. Hope this helps.

Code:
<body style="text-align:center;">

<div style="width:760; height:420; margin:0 auto; border-collapse:collapse;">
Main console here!
</div>

</body>
 
My mistake you do do not need the colapse property
 
I don't think that will solve the "vertical" aspect of the posters problem though...

I'm sure there are a few solutions that will solve this but here's one I had bookmarked:



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top