homepage Welcome to WebmasterWorld Guest from 54.198.42.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
how to differentially set link styles?
scorpion




msg:1213412
 10:20 pm on Feb 22, 2003 (gmt 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

 

tedster




msg:1213413
 10:30 pm on Feb 22, 2003 (gmt 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-- }

scorpion




msg:1213414
 7:02 am on Feb 23, 2003 (gmt 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!

DrDoc




msg:1213415
 7:18 pm on Feb 23, 2003 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved