|
 |
|
|
|
04-14-2006, 04:35 PM
|
cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
See my sidebar here in firefox: www.tammyhartdesigns.com/blog
It's all done with css, and the links are generated by the php. What's up?
|
|
|
|
04-14-2006, 06:33 PM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Tammy I'm not entirely sure what the issue is, but I'm guessing it's the extra space between the links in IE. If it is then I think you just need to specify a margin on the links. I see you have padding applied now.
Some of the cross-browser issues are due to each browser having a different defualt value on a lot of properties. I've found margins and paddings being one place where IE and Firefox differ. Usually if you explicitly set both te two browsers get in synch.
Let me know if that works or not or if I completely misunderstood the issue. I have been known to do that.
|
|
|
|
04-15-2006, 11:37 AM
|
Re: cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
Okay, here is the css for the list:
Code:
#sidebar ul li {
list-style-type: none;
list-style-image: none;
margin: 0px;
padding:0px;
}
And here's the css for the links :
Code:
#sidebar li a {
display: block;
text-decoration: none;
padding: 0 5px 0 0;
color: #666666;
margin: 0px;
}
#sidebar li a:hover, #sidebar li a:active {
background-image: url(images/sidebar_bg_over.jpg);
background-position:right;
background-repeat:repeat-y;
padding: 0 5px 0 0;
color: #666666;
margin: 0px;
}
And then, I have the div that the list for the generated links in a div with the id of sidebar.
|
|
|
|
04-15-2006, 08:04 PM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
I can be wierd with lists. I think it has a some defaults that force the height to be larger than you want. One of the hacks I've tried is to give a height to the <li> only for IE as 0.5%. That seems to close up the space. You can guarantee that IE will use that height and other broswers will ignore it by using an underscore in front so:
li {_height:0.5%}
You can do that with any css property as long as the one with the underscore comes after the one without.
See if adding that _height to the <li> closes things up in IE. I've had the same problem myself often and that has usually solved it for me. If not just let me know and I'll take another look.
|
|
|
|
04-15-2006, 08:31 PM
|
Re: cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
I found out what it is. It's the display:block. when I comment that out, it goes back right, but then the hovering background is only behind the letters and not the entire span of the div like it's supposed to be.
Last edited by tammyhart; 04-15-2006 at 08:37 PM..
|
|
|
|
04-19-2006, 06:16 PM
|
Re: cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
I don't understand why IE looks at the block diferently. Is there another way I can make the a:hover bg span the entire width of the div without display:block?
(I say we sign a petition that unites all browser programmers and get rid of all these stupid cross compatibility migraines!)
|
|
|
|
04-19-2006, 06:27 PM
|
Re: cross-browser problem
|
Posts: 102
|
The problem is actually pretty simple.
When you put an anchor to block, IE wants to see dimensions. Or at least a width. Put a width on #sidebar li a and you're fine 
|
|
|
|
04-19-2006, 06:38 PM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Tammy I think it's just that different browsers have different different defaults for a lot of things. Usually when things aren't aligning the same in Firefox and IE I'll explicitly give the element values for margins and paddings and widths and heights, etc. That will usually (though not always) at least get them displaying the same and from there I can play around with the values to get the exact spacing I want.
I know IE has a weird quirk with lists items and I've found that using the 0.5% for the height (or maybe the line-height) seems to close up the lists.
|
|
|
|
04-19-2006, 11:20 PM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
That's interesting. I had never seen that before. Goof to know since I never cared for the 0.5% hack thing. I just knew it worked. Thanks.
|
|
|
|
04-20-2006, 04:41 AM
|
Re: cross-browser problem
|
Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
|
Quote:
|
Originally Posted by ghettobert
The problem is actually pretty simple.
When you put an anchor to block, IE wants to see dimensions. Or at least a width. Put a width on #sidebar li a and you're fine 
|
block level elements will occupy the entire width of the parent container unless a width is specified.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
04-20-2006, 05:09 AM
|
Re: cross-browser problem
|
Posts: 102
|
Quote:
|
Originally Posted by chrishirst
block level elements will occupy the entire width of the parent container unless a width is specified.
|
Indeed. But somehow IE stretches the height of the li tag when there's no width on the anchor. If there's any logical explanation for this I do not know ..
|
|
|
|
04-20-2006, 12:14 PM
|
Re: cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
Okay, it worked as far as taking the space out, but it maade the text disappear. Not in Opera or firefox, just in IE. I'm using version 7, btw. I'll leave it that way so you can see.
|
|
|
|
04-20-2006, 03:13 PM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Tammy I seem to be able to see everything in IE6. Did you fix things?
|
|
|
|
04-20-2006, 11:52 PM
|
Re: cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
Perhaps it's a version difference. In IE7, the links in the sidebar have the hovering effect, but the text is not there. I can mouseover where each link is, but there's no text to be seen. I'm glad to know that it's working in version 6, not too many people have switched to 7 yet.
|
|
|
|
04-21-2006, 02:11 AM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Maybe it is just IE7. I checked again to make sure and I'm still seeing the links in IE6. Version 7 is still in beta too so maybe it's a bug that still needs to be fixed. I can't imagine anything anyone here suggested would have caused that.
What method did you use to close up the space?
|
|
|
|
04-21-2006, 12:20 PM
|
Re: cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
I gave the anchors a width.
|
|
|
|
04-21-2006, 03:07 PM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Yeah I can't imagine that would cause the problem you're seeing in IE7. I thought maybe if you'd gone with my 0.5% height hack IE7 was making things to small to see. Let's hope it's just a bug in IE7.
|
|
|
|
04-22-2006, 01:55 AM
|
Re: cross-browser problem
|
Posts: 212
Location: Birmingham, AL
|
I tried what you said, and it didn't do anything.
|
|
|
|
04-22-2006, 02:38 AM
|
Re: cross-browser problem
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Weird it's worked for me before. Did you apply it to the links or the list-items? I think it only works on the list items. Maybe it's not for all cases though. It's not something I've used a lot, but it has worked on a few sites.
I think I'm going to have to try specifying the width of the link though in the future since I like that better as a solution.
|
|
|
|
|
« Reply to cross-browser problem
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting 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
|
|
|
|