Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems With Anchors in Netscape

Status
Not open for further replies.

SarahKate31

Programmer
Feb 14, 2002
34
US
Hi all -

Here's the problem I'm having with Netscape. I have put anchors around table cells like this:

<a name="katie"><td width="235" valign="top">Katie Bell</td></a>

Links elsewhere on the page or on other pages that are supposed to link to this section work fine in IE, but in Netscape they just seem to send you to the first anchor on that page no matter what it is. Are you not allowed to put an anchor around a table cell? Any info about why this works in IE and not Netscape, or how to make it work in Netscape (ideally) would be much appreciated!

Thanks so much, Kate

 
You can't have anchor tags surrounding td tags.

Do something like this:

Code:
<td width="235" valign="top"><a name="katie">Katie Bell</a></td>

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
cLFlaVA --

I was afraid of that, but thanks so much!

-- Kate
 
Hi again --
Sorry I have another question. I fixed the anchors and they work now, but they are underlined. I have a section of CSS that defines the actual links

a.black:link { color: #eaeaea; text-decoration: underline }
a.black:active { color: #eaeaea; text-decoration: underline }
a.black:visited { color: #eaeaea; text-decoration: underline }
a.black:hover { color: #564558; text-decoration: underline }

and the links look fine - they are underlined just like they're supposed to be, but the text inside the anchors

<a name="katie">Katie Bell</a>

is also underlined. How can I remove the underline from the anchors but not the links? Should I define another class?

Thanks -- Kate
 
Yeah, you'll need to define another class. Something like this:

Code:
a.black:link { color: #eaeaea; text-decoration: underline }
a.black:active { color: #eaeaea; text-decoration: underline }
a.black:visited { color: #eaeaea; text-decoration: underline }
a.black:hover { color: #564558; text-decoration: underline }

a.other:link { color: #eaeaea; text-decoration: none }
a.other:active { color: #eaeaea; text-decoration: none }
a.other:visited { color: #eaeaea; text-decoration: none }
a.other:hover { color: #564558; text-decoration: none }

And then:

Code:
<a class="other" href="linky.html">Cory Arthus</a>
<a name="katie" class="other">Katie Bell</a>

You could also just define the default a tags:

a:visited {...}

etc., if you wanted to, rather than calling it 'other'.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
2 options:

1. Add this to your code

a { text-decoration: none; }

Add this to your code:

a.anchor { text-decoration: none; }

In the first method, all links without class="black" will not be underlined.

In the second method, only links with class="anchor" will be underlined. Add 'class="anchor"' to each anchor tag.

P.S. Your black class can be simplified to this:
a.black { color: #eaeaea; text-decoration: underline }
a.black:hover { color: #564558; text-decoration: underline }

Thus the name: Cascading Style Sheets!

--Chessbot

"So it goes."
Kurt Vonnegut, Slaughterhouse Five
 
cLFlaVA & Chessbot --

Thanks so much! It looks fine now. I really appreciate your help - sorry for the remedial question!

-- Kate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top