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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.class :link {...} OK?

Status
Not open for further replies.

csstefan

Programmer
Sep 26, 2002
10
SE
I'm just wondering if I'm doing right here..., maybe someone can help me.
In my stylesheet I have the code:

.leftmenu :link {...}
.leftmenu :visited {...}
.leftmenu :link:hover {...}
.leftmenu :visited:hover {...}

And in the html document (inside a table):

<div class=&quot;leftmenu&quot;>
<p><a href=&quot;something1.html&quot;>something1</a></p>
<p><a href=&quot;something2.html&quot;>something2</a></p>
</div>

This seems to works. Still feeling kind of worried, haven't seen this in any css syntax examples. I've just seen examples like this, where you have to put the class inside every <a>:

a.leftmenu :link {...} combined with
<a class=&quot;leftmenu&quot; href=&quot;something.html&quot;>something</a>

Is &quot;my&quot; method correct?

 
Yes, your idea is correct.
But you shouldn't place any spaces here: .leftmenu_:visited {}
it should be:
.leftmenu:visited {}
 
Hmm,just checked - if I don't have the space it doesn't work in NN4.x (mac).
 
Hi,

I use this:

.leftmenu A:link {...}
.leftmenu A:visited {...}
.leftmenu A:hover {...}
.leftmenu A:Active{..}

Any good?

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top