Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Absolute slew of problems… Re: Absolute slew of problems…

#71580
TheDoc
Member

Your coding looks very clean, so bravo on that, it’s a good start.

You haven’t, however, set a Doctype, which is pretty important. (just search "doctype" in Google for more info)

Your main nav is wrapped in a <p> tag. This is a no-no on many different accounts, so remove it.

You have an H2 header of "Navigation" before your nav, this is unnecessary (redundant). You can remove that.

Speaking of your navigation, you have a <div> that is wrapping your <ul>. Did you know that you can actually just style the <ul> just like you would the <div>? This means you don’t have to have redundant divs wrapping everything. So instead of:

Code:

You can just do:

Code:

You also have a few errors in your CSS file which will cause things to look a little different than you intended:
http://jigsaw.w3.org/css-validator/vali … =1&lang=en

You need to assign a unit of measure any time you give a size. So for padding, for example, you can’t put:

Code:
padding: 5.5;

You need to put:

Code:
padding: 5px;

or

Code:
padding: 5.5em;

Note that ems and pixels are VERY different units of measurement.

I would also use a CSS Reset (Google that for more info if you want). I use the most simple form myself, throw this in the top of your CSS file:

Code:
* { margin:0; padding:0; }

Each browser has its own default margin and padding that it applies to certain elements on a page. What this line of code does is reset that so that you have full control over everything. It’s very important to do, and missing it is the cause of lots of headaches for people just starting out.

That should help ya fixing some of those problems!