View Full Version : style.css / html layout trouble

02-23-2008, 10:07 PM
I have this layout I made by reading this tutorial, and the navigation doesn't seem to look right, it's suppose to be at the very top but its always at the bottom of the content,
I might have done something wrong because I didn't follow the tutorial exactly, so err can anyone help?


There's the layout code,
It looked okay in mozilla, so it only looks wierd in ie (or the last time i checked, it did) and i'm not really sure if the problem is in the style sheet or the html file...

thanks ^^

02-23-2008, 10:24 PM
Float the sidebar to the left and add this at the top of your page.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

and in #container add margin:auto;.

02-24-2008, 04:05 AM
I did what you asked but all it did was put the sidebar/navigation below the text, since both are put to float: left;
and was I suppose to add margin: auto or replace it to margin: 0?

and for the code i'm utting at the top of the page, am I suppose to put it above <html>? I've seen it before, don't you add it to check if the layout is validated in html? (I think)

sorry for all the questions ><;;

02-24-2008, 05:05 AM
No the doctype is there so the browser knows how to render the page. Without it IE goes into quirks mode. I forgot to mention that you need to remove this from #main

width : 100&#37;;
clear : both;
Because of that the sidebar had no where to go. margin:auto; replaces margin:0;

The doctype is in the correct place.

02-24-2008, 07:19 AM
thank you!!!