 |
 |
Weird CSS Problem
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
Hey guys,
I'm having a weird CSS problem with a site I'm making, basically. I have a menubar on left thats vertical. I want to use links with <li>'s. But when I do, a space is left at the top. This is what I mean:
If I put some text out of the [ul] this is what it looks like:
Here is my code:
Code:
<ul id="navigationList">
<li><a href="f">Item1</a></li>
<li><a href="f">Item1</a></li>
<li><a href="f">Item1</a></li>
<li><a href="f">Item1</a></li>
</ul>
And my CSS code:
Code:
#navigationList {
padding-left: 4px;
margin-left: 0px;
width: 177px;
}
Thanks,
Oliver
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
I see the problem.
Put padding: 0 on #navigationList.
Once you've done that, use "#navigationList li" as your selector to deal with things that go on your listItems. So an example might look like this:
Code:
#navigationList {
padding-left: 4px;
margin-left: 0px;
width: 177px;
}
#navigationList li {
/* style your links here */
}
Note that anything in a "navigationList li" block will only apply to list items inside #navigationList. This lets you style any list items outside #navigationList normally.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
Try margin: 0; on your navigation list. Also if you're just using 0 as a value then you don't use "0px" rather just "0".
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
The margin: 0 thing did it, thanks all for the help  .
Thanks,
Oliver
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
Originally posted by Synotic:
Try margin: 0; on your navigation list. Also if you're just using 0 as a value then you don't use "0px" rather just "0".
Technically you can omit the "px" from the 0, but it's generally not the greatest of ideas to do so, at least not while you're debugging. It can make changing lengths a little more of a hassle if you need to do so for some reason.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |