CSS: Two-seperate styles for links on one page?

themacko

Barking at the moon.
Hi, I'm wondering if this is possible. I have links at the top of the page that I would like to be one style (large, light-tan, etc.) but I would like the links within the text of the main page to be a completely different style. How can I differentiate the two?

Thanks for your help!!

P.S. I attached my current style sheet if that helps at all. :confused:
 

Attachments

  • style.txt
    1 KB · Views: 10
You can do this in a few different ways - but the simplest is to just give a class to the links you want to appear differently. Try <a class="big" href="..."> and <a class="small" ...
Then in the css do a.big to select the big links, and a.small to select the little ones.
 
Yeah. And the :link :visited :hover stuff work like that too. i.e. a.big:link a.big:visited a.big:hover all work.

It's pretty nice. :)
 
Some tables are good, but only for organizing the content as such. For general layout, tables = bad.

That's a different conversation though...
 
Stop there. Adding classes to the link ? href="" class="" ? What for ?

Your top of page should be a different <div> from your main content, right ?

Then:
#topofpage a:link { the link's style }
#maincontent a:link { another style }

As usual, I'll quote my website as evidence of this method, which is fast and semantically simple: www.phnk.com . Look at the sidebar: links are different, the coding implies no classes. :p
 
Not just simple, but a better method and leaves cleaner code in the main document.
 
Back
Top