Welcome to WebmasterWorld Guest from 107.20.110.201

Forum Moderators: not2easy

Message Too Old, No Replies

CSS in NS 4.7 issue

image border?

     

RussellC

8:55 pm on Aug 23, 2002 (gmt 0)

10+ Year Member



I have this in my CSS:

img
{
border: 0;
}

I also have this:

body
{
margin: 0px;
padding: 0px;
color: #000000;
background-color: #FFFFFF;
}

These don't work in NS 4.7 even though I think they are supported. Do i need to add something for it to look better in the old browser. My font styles work correctly.

[added] only images that are links are affected with borders [/added]

-Russell

tedster

4:17 pm on Aug 24, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I'm mystified, Russell. It works for me in Netscape 4.77, Win98 - no border around the linked image.

andreasfriedrich

4:28 pm on Aug 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to try this one.

img { 
border-style:none;
border-width:0px;
}

Itīs what I use in my NS4.x style sheets and it works for me.

bobriggs

4:46 pm on Aug 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



andreasfriedrich:

Doesn't work for me. I had given up a long time ago on this problem and had to put border="0" in the img tag itself inside linked images.

rewboss

6:10 pm on Aug 24, 2002 (gmt 0)

10+ Year Member



NS 4.x has serious problems related to inheritance. Do you have your images inside paragraphs or tables or other block-level elements? How much nesting is there? By the time you get to three or four levels of nesting, Netscape 4 just wants to give up and go home, it seems.

RussellC

6:28 pm on Aug 24, 2002 (gmt 0)

10+ Year Member



I changed mine back to an inline border="0" for now...i'll try your suggestions on monday. Thanks a bunch.

RussellC

8:46 pm on Aug 24, 2002 (gmt 0)

10+ Year Member



oo...I forgot about the margins

margin: 0px;
padding: 0px;

how do i get those to render correctly in NS? thx

bobriggs

9:39 pm on Aug 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rewboss: Inside a <table> inside <body> on what I tested. I guess that's two levels, or one, depending on how you look at it (since it has to be in <body> anyway)

I know about the inheritance. That's why it's more efficient for me to use the border="0" inside a link because the <img> could be anywhere, and I can't rely on NN4 to make an educated guess. I'd have to come up with all kinds of combinations for the cascade otherwise.

bobriggs

11:49 pm on Aug 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know the restrictions against posting code. but here is a minimal test. Just load this into NN4:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<STYLE type="text/css">
<!--
img { border-style:none; border-width:0px;}
-->
</STYLE>
</head>
<body>
<a href="http://www.google.com/"><img src="http://www.google.com/images/logo.gif" width="276" height="110" alt=""></a>
</body>
</html>

Don't ask me why I used google logo. It's just that it is probably in everyone's cache here anyway. Also note that the <img> is not nested in any way. It just doesn't work.

tedster

3:22 am on Aug 25, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Just to clarify - minimal code, such as bobriggs posted, which helps to clarify issues under discussion, is fine. What we ask people to avoid is a do-my-work-for-me code dump. No one should copy/paste of 40 lines of code with a nebulous message of "It doesn't work - please fix it for me".

If you do your homework, zero in on the code snippet that's acting up and what the issue is, and still can't make it work after honest effort an understanding, then it's ok to post a LITTLE BIT of code - the very little bit you zeroed in on as being where the issue resides.

But it's still better to explain it in ordinary language as much as is possible. It's much more useful to other members AND it's more likely to draw helpful responses if others don't need to wade through a page trying to understand the logic behind a big chunk of code.

I also have a confession to make - I don't know what I was looking at his morning, but tonight I cannot get any of the CSS for link borders to work in Netscape 4. I've tried declarations for img {}, for a img{}, and creating a special class for images used in an anchor. I've tried "border" and "border-style".

The best I can come up with so far is to declare a border of 0 and a border-color that matches the background-color. But the border's still there, only it's harder to notice because of the color. If the space used for the border is an issue, this is still not an acceptable solution.

bobriggs

4:15 am on Aug 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry for posting code. I know it can get out of hand. The problem is that NN4 thinks the style is for the anchor, not the border.

So one solution is:
<a style="border:none;" ....

in that same code. That works. Seems a little more expensive than border="0", but for purists...

tedster

4:29 am on Aug 25, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The problem is that NN4 thinks the style is for the anchor

That's the key - well done bobriggs!

So in an external sheet, if we don't style the img tag but we style the anchor, then Netscape 4 gets the message:

a:link {
border:none;
}

rewboss

5:36 am on Aug 25, 2002 (gmt 0)

10+ Year Member



NS 4 doesn't implement margin and padding for the body element. YOu have to use HTML attributes in the <body> tag:

<body marginwidth="0" marginheight="0">

 

Featured Threads

Hot Threads This Week

Hot Threads This Month