Forum Moderators: not2easy

Message Too Old, No Replies

How to do the "table trick" in CSS

         

isorg

3:13 pm on Apr 12, 2007 (gmt 0)

10+ Year Member



I have the following code:


<html>
<head>
</head>
<body>
<div style="margin:auto; width:770px;border:3px solid blue">
<div style="position:absolute; top:75px;width:770px;z-index:1;border:1px solid red">
<p>This is the main body of the page, which cunningly comes above the navigation. This is old-school SEO, hey!?
</div>
<div style="position:absolute; top:0px; width:770px;border:1px solid green;z-index:0;">
<p>Navigation bar
</div>
</div>
</body>
</html>

This will produce a page where the main body of the text comes at the top of the document, whereas the naviation links etc. come at the bottom of the page.

Now, this code works for a fixed-width layout (770px in this case).

Is there any way of getting the same effect but using a variable width e.g. 80% of the browser window...?

I've been racking my brains out with this one :-(

MatthewHSE

4:53 pm on Apr 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe I'm missing your question, but setting the widths to 80% instead of 770px worked for me.