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
Too much space between bullet and text in IE7
Old 03-26-2008, 03:00 AM Too much space between bullet and text in IE7
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
I've redone my left navigation menu in CSS here:
http://www.icdmeister.com/test/

It's laying out perfectly in FF but in IE7 there's extra space between the bullet (which is a background image) and the text of the list item.

What do I need to do to get this to look right in all browsers?

Andrew

P.S. After getting feedback from this forum on several related CSS issues, before posting I made sure I had my doctype declared and validated my XHTML and CSS. Thanks to all who've gently (and not so gently) helped me come along. -A.
aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
 
Register now for full access!
Old 03-26-2008, 06:16 PM Re: Too much space between bullet and text in IE7
Webmaster Talker

Posts: 626
Trades: 0
Why don't you use the list-style-image property to accomplish the bullet instead of making it a background image?

http://www.w3schools.com/css/css_list.asp
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 03-26-2008, 11:49 PM Re: Too much space between bullet and text in IE7
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
I've tried it both ways and neither comes out looking good in both FF and IE7

Here's screenshots of the menu when I use the image as the bullet. I'm pretty happy with this in IE7 (although I'd prefer a little more space between the bullet and the text) but it's no good in FF because of the margin-left: -10px (CSS follows):

IE7

Firefox


ul.leftnavul
{
list-style: url(
http://www.icdmeister.com/images/nav_bullet.jpg) inside;
margin: 3px 0 0 3px;
padding: 0px;
}

li.lnavli
{
padding-left: 0px;
margin-left: -10px;
margin-bottom: 7px;
position
}


When I use the bullet image as a background, in contrast, all looks well in FF but I can't get rid of the space between the bullet and the text in IE7.

Here's how it looks:

FF


IE7


And here's the CSS for that:

ul.leftnavul
{
list-style: none inside;
margin: 3px 0 0 3px;
padding: 0px;
}


li.lnavli
{
background-image: url(
http://www.icdmeister.com/images/nav_bullet.jpg);
background-repeat: no-repeat;
padding-left: 6px;
margin-bottom: 7px;
background-position: 0px;
}


Any suggestions are welcome.

Andrew


aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
Old 03-28-2008, 02:46 AM Re: Too much space between bullet and text in IE7
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
No one has any suggestions or potential solutions?

A.
aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
Old 03-28-2008, 11:24 AM Re: Too much space between bullet and text in IE7
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
I'm going to take a look at it, just didn't have any time yesterday. I'll see if I can get it fixed.

Ok, found the problem. You have this:
Quote:
ul.leftnavul
{
list-style: none inside;
margin: 3px 0 0 3px;
padding: 0;
}
REMOVE the 'inside' and the gap will go away. If you're not using the default list image, it's pointless, and problematic, to specify a position for a non-existent bullet.

I would also suggest that you can vastly simplify your CSS and your coding by using the cascade and specificity. I changed your list to this:

Quote:
ul.leftnavul li
{
background: url(nav_bullet.jpg) no-repeat;
padding-left: 6px;
margin-bottom: 7px;

}

ul.leftnavul li a:link {
color: #006378;
text-decoration: none;
padding: 0;
margin: 0;
}
ul.leftnavul li a:visited {
color: #006378;
text-decoration: none;
}
ul.leftnavul li a:hover {
color: #E3EEF1;
background-color: #15AFCB;
}
ul.leftnavul li.last{
margin-bottom: 3px;
}
The .last class gets the inline styling out of your html. All that simplifies your HTML to this:

Quote:
<li><a href="#">Metabolic</a></li>
<li><a href="#">Musculoskel</a></li>
Much cleaner, and less work for you.

Now, you need to clean up the float drop problems you have with IE6.
__________________
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


Last edited by LadynRed; 03-28-2008 at 11:55 AM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-28-2008, 11:25 AM Re: Too much space between bullet and text in IE7
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
If all else fails, you could use a conditional statement for IE. I am sure LadynRed will figure out a better solution though!

I am on a Mac right now, but if I get access to IE later, I will take a look at it too.
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 03-29-2008, 12:28 PM Re: Too much space between bullet and text in IE7
aschecht's Avatar
Extreme Talker

Posts: 190
Name: A
Location: San Jose, CA
Trades: 6
Quote:
Originally Posted by LadynRed View Post
Ok, found the problem. You have this:
REMOVE the 'inside' and the gap will go away. If you're not using the default list image, it's pointless, and problematic, to specify a position for a non-existent bullet.
You are my hero! I could have sworn I had tried it with and without the "inside" attribute but I guess not. I knew there had to be a small change like this that I was missing. You rock, LnR!

Your suggestion to simplify the CSS is well-taken. When I was doing it I knew it was inelegant and messy to apply the class to each li for instance but I'm still not clear on inheritance, cascading, and specificity. I'm going to study your revision of my code then do some general reading about this because it looks like something well worth understanding clearly.

I just saw the IE6 issue, I think it has something to do with things not fitting within defined widths once margins/padding are added and then dropping down to the next level. I'll take a stab at this today.

Thanks a ton!

Andrew

Last edited by aschecht; 03-29-2008 at 01:16 PM.. Reason: extra text left behind
aschecht is offline
Reply With Quote
View Public Profile Visit aschecht's homepage!
 
Reply     « Reply to Too much space between bullet and text in IE7
 

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 0.26057 seconds with 12 queries