2 replies [Last post]
stickles
Offline
newbie
Last seen: 14 years 44 weeks ago
Joined: 2007-01-25
Posts: 2
Points: 0

Hi I am really new to CSS and have a question. I have copied and pasted a horizontal nav but for some reason the nav won't move up. For instance, if you have a table above it.. it will not move up right below that table. The stuff inside seems aligned middle inside the div tag.

Even if I put it in a table it still wont go to the top. I hope someone understands what I am trying to say.. Basically it seems like the horizontal menu is in the middle of the div tag, like there is white space below and above it.. I just want it to be on the top with no white space above or below it...
Here is the CSS code:
#today ul
{padding-left: 0; margin-left: 0; background-color: #205d89; color: White; float: left; width: 100%;
font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-weight: bold;}

#today ul li { display: inline; }

#today ul li a
{padding: 0.2em 1em; background-color: #205d89; color: White; text-decoration: none; float: left; border-right: 1px solid #fff;}

#today ul li a:hover
{background-color: #369; color: #fff;}

Here is the HTML Code:




thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 22 hours 9 min ago
Joined: 2004-06-30
Posts: 9679
Points: 815

You don't need to wrap it in

You don't need to wrap it in a table or a div, so first thing to do is remove that extraneous markup and apply the styles directly to the UL.

ULs have default margins and padding which you haven't zeroed. Try that and see what happens.

Verschwindende wrote:
  • CSS doesn't make pies

stickles
Offline
newbie
Last seen: 14 years 44 weeks ago
Joined: 2007-01-25
Posts: 2
Points: 0

Thank you thepineapplehead.

Thank you thepineapplehead. By setting the marin and padding for my UL I acheived what I wanted to do.

Thank you again for your help!