Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
How to remove these extra margins from list tags?
Old 04-25-2010, 11:14 AM How to remove these extra margins from list tags?
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
I am using the following to center list items inside an unordered list:

HTML Code:
        <div id="navigation">
            <ul>
                <li>Home</li>
                <li>Schedule</li>
                <li>Tickets</li>
                <li>News</li>
            </ul>
        </div><!-- navigation -->
Code:
#navigation {
    padding: 3px 3px 5px 3px;
}
#navigation ul {
    list-style-type: none;
    text-align: center;
}
#navigation ul li {
    display: -moz-inline-stack;
    display: inline-block;
    zoom: 1;
    *display: inline;
    padding: 3px 10px;
    border: 1px solid green;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: bold;
}
The problem is, in the latest versions of ff, sf, ie8, op and chrome the list items have a right and left margin like so:



I can't figure out why this is, there is no margin being added to the list items in the css. Can a fresh pair of eyes see
the problem and figure out a possible solution?

I should mention, that it works as it should in internet explorer 7 (this is how I need it to be in the other browsers as well):



UPDATE: adding margin: 0 to the li style doesn't work.

Last edited by Marik; 04-25-2010 at 11:21 AM..
Marik is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-25-2010, 11:17 AM Re: How to remove these extra margins from list tags?
Novice Talker

Posts: 4
Trades: 0
Some elemets have margin: x by default. Try add margin:0; in the #navigation ul li {.
ghis is offline
Reply With Quote
View Public Profile
 
Old 04-25-2010, 11:20 AM Re: How to remove these extra margins from list tags?
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
Sorry, I should have mentioned. The first thing I tried was adding margin: 0 to the li style and it had no effect on it.
Marik is offline
Reply With Quote
View Public Profile
 
Old 04-26-2010, 02:27 PM Re: How to remove these extra margins from list tags?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
So - lets see the problem page or post ALL of your code.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-27-2010, 01:11 AM Re: How to remove these extra margins from list tags?
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
Quote:
Originally Posted by LadynRed View Post
So - lets see the problem page or post ALL of your code.
That is all my code

I am just trying to get this navigation to work right on an otherwise empty page. So any conflict with other styles isn't a possibility.
Marik is offline
Reply With Quote
View Public Profile
 
Old 04-28-2010, 08:30 PM Re: How to remove these extra margins from list tags?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Remove the spaces between you <li> items in your html -- like this:

<li>Home</li><li>Schedule</li><li>Tickets</li><li>News</li>

Spaces go away. Seems stupid that those spaces matter.. but that is not at all uncommon.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-28-2010, 10:46 PM Re: How to remove these extra margins from list tags?
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Remove the spaces between you <li> items in your html -- like this:

<li>Home</li><li>Schedule</li><li>Tickets</li><li>News</li>

Spaces go away. Seems stupid that those spaces matter.. but that is not at all uncommon.
He he, that did it. I never encountered this before, that putting html on a second line will cause any difference on the front end. You learn something new everyday, thanks LadynRed!
Marik is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to remove these extra margins from list tags?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 7.30560 seconds with 12 queries