Forum Moderators: open

Message Too Old, No Replies

Image Border Color

Not applying, hmmmm.

         

guiroo

9:41 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



Here's the scenario, it's for an image gallery. I've specified a border of 1px on the thumbnail. For some reason it doesn't follow the style and displays default blue. (This only occurs in IE on PC.)

The odd thing is some pages work while some don't. Same style sheet, same formatting of the code.

Am I missing something? Is there a trick or property I'm missing?

Here are some examples....

Correct Thumb Border Color:
<snip> please review the posting terms of service </snip>(Actually this one is not perfect either, the hoover doesn't work either.)

Incorrect Thumb Border Color:
<snip>
Thanks!

P.S. I know I'm not using CSS to its fullest extent here. So no need to comment on other stuff I could have done better. :)

[edited by: papabaer at 10:40 pm (utc) on July 9, 2002]

OhMyPixel

10:17 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



That is because you set the link color in your body tag in the first one. In the second link your body tag as no attributes.

p.s. I don't know if posting links is considered kosher.

guiroo

10:27 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



Sorry if the links aren't cool I won't do it again.

OhMyPixel, thx for pointing that out, I must have left that in there while trying to find a solution. It should be pulling from the style sheet anyway. Take a look at it in NS6 to how it should work.

Thx!

OhMyPixel

10:37 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



It still shows the link color code in the body tag in the first one. There is also no link color code in the second link.

papabaer

10:50 pm on Jul 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello guiroo, welcome to Webmaster World! We don't allow posting of affiliated links for a number of reasons, you can however post examples of the CSS or code. It sounds like OhMyPixel has already spotted the potential problem. Since yout thumbnails are used as links, the 1px border will be subject to the declared link colors. You may want to define an anchor class for the thumbnails alone.

guiroo

3:00 am on Jul 10, 2002 (gmt 0)

10+ Year Member



Sorry about that. No more links.

Let me add that I have defined a seperate anchor class for the the thumbs but still no luck. Grrrrrrr. Again it's only on PCs with IE.

Can someone else try this to see if they can do it? Or if anyone has other suggestions I'd appreciate it.

Thx!

moonbiter

1:46 pm on Jul 10, 2002 (gmt 0)

10+ Year Member



I believe a discussion of this problem and possible workarounds can be found at:

[webmasterworld.com...]

moonbiter

2:39 pm on Jul 10, 2002 (gmt 0)

10+ Year Member



You know, this problem has bothered me since it was first brought up in the other thread I mentioned. Specifically, I couldn't get the hover links to work for the images in IE. For example, if you declare:

a:link img {
border: 3px solid black;
}

a:visited img {
border: 3px solid blue;
}

a:active img {
border: 3px solid red;
}

a:hover img {
border: 3px solid white;
}

The hover effect will work in Mozilla, but not in IE. And if you do:

a:link {
color: black;
}

a:visited {
color: blue;
}

a:active {
color: red;
}

a:hover {
color: white;
}

img {
border-width: 3px;
}

You get the default link colors in MSIE (this still works correctly in Mozilla). However, if you do this:

a:link {
border-color: white;
}

a:visited {
border-color: orange;
}

a:active {
border-color: green;
}

a:hover {
border-color: black;
}

a:link img {
border: 3px solid black;
}

a:visited img {
border: 3px solid blue;
}

a:active img {
border: 3px solid red;
}

a:hover img {
border: 3px solid white;
}

It works in both MSIE and Mozilla. Wierd. I believe this is a bug in MSIE, because the first example kind of works in that browser, but it just doesn't seem to be able to pick up the onmouseover event to fire off the color change. I think this is because of how MSIE detects events on nested elements (but I won't get into that here).

Note that it also works if you declare color instead of border-color on the links.

Notice also that I am not even using the same colors for the link states on the two declarations (example; a:link {border-color: white;} a:link img {border: 3px solid black;}), and yet the img link borders still come out the right color. All that seems to matter to MSIE is that some color is declared on the link, no matter what that color is. This is useful in that it might allow you to declare one type of color for a link on a page, and use a different color for the link on the img.

Anyway, that's what I've found out, and maybe it will be useful to someone.

p.s., I couldn't get any of this to work Opera, so I don't know what the deal is there.

guiroo

4:06 pm on Jul 10, 2002 (gmt 0)

10+ Year Member



Thanks for the testing and reference to other topics! At least I know it wasn't just me now.