Welcome to WebmasterWorld Guest from 54.198.100.141

Forum Moderators: not2easy

Message Too Old, No Replies

how to differentially set link styles?

     
10:20 pm on Feb 22, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 15, 2002
posts:450
votes: 0


Does anybody know how to have a page where for example

links (a href=...) in a menu bar are NOT bold and 10pts BUT

links in say a table or somewhere else on the page are BOLD and 11pts.

If i define the link or a tag, it seems to be global for the whole page...thanks

10:30 pm on Feb 22, 2003 (gmt 0)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


Two approaches come to mind:

1. Create a class (let's call it "nav") and apply that class just to the anchor tags that you choose <a href="page.htm class="nav">TEXT</a>

a.nav { -- rules -- }
a.nav:visited { --rules-- }
a.nav:hover { -- rules -- }

2. If all of one style of link will be within a div (say its ID is "navi"), then declare some rules for any anchor tags that are child elements in that div

#navi a { --rules-- }
#navi a:visited { --rules-- }
#navi a:hover { --rules-- }

7:02 am on Feb 23, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 15, 2002
posts:450
votes: 0


will not the definition of a.link interfere with this since a.link refers to all links on the page? or will a.nav override a.link? I'm kinda new to this, but I'll try it out!
7:18 pm on Feb 23, 2003 (gmt 0)

Senior Member

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

joined:Mar 15, 2002
posts:6807
votes: 0


a.nav:link will override a:link .. as long as the rule is specified in a.nav too.

For example, if a:link has a border, not specifying a border for a.nav:link will still give it a border because of a:link. Hence, the a.nav section marks changes to the general anchor section.