Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Weird CSS Problem

Weird CSS Problem
Thread Tools
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Jan 25, 2004, 08:43 AM
 
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
Reply With Quote
Jan 25, 2004, 09:28 AM
 
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
Reply With Quote
Jan 25, 2004, 10:30 AM
 
Hmm, so I put padding in navigationList and followed what you said and that didn't seem to work. Would you mind looking at the html/css?

Heres the url:

http://www.talacia.com/sites/puertob...ents/index.php

And the CSS file:

http://www.talacia.com/sites/puertob...nts/global.css

Thanks,
Oliver
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Jan 25, 2004, 10:56 AM
 
Originally posted by iOliverC:
Hmm, so I put padding in navigationList and followed what you said and that didn't seem to work. Would you mind looking at the html/css?

Heres the url:

http://www.talacia.com/sites/puertob...ents/index.php

And the CSS file:

http://www.talacia.com/sites/puertob...nts/global.css

Thanks,
Oliver
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
Reply With Quote
Jan 25, 2004, 11:09 AM
 
The margin: 0 thing did it, thanks all for the help .

Thanks,
Oliver
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 25, 2004, 01:55 PM
 
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!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:53 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2