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



## themacko (Nov 1, 2003)

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.


----------



## mr. k (Nov 1, 2003)

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.


----------



## Darkshadow (Nov 1, 2003)

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.


----------



## mr. k (Nov 1, 2003)

css is great!  tables layouts suck!  power to the web standards...


----------



## themacko (Nov 2, 2003)

Thanks guys, that's exactly what I was looking for!


----------



## Dreamify (Nov 6, 2003)

CSS _is_ great, but I still like building layouts with some tables.


----------



## Arden (Nov 9, 2003)

Some tables are good, but only for organizing the content as such.  For general layout, tables = bad.

That's a different conversation though...


----------



## toast (Nov 10, 2003)

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.


----------



## mdnky (Nov 10, 2003)

Not just simple, but a better method and leaves cleaner code in the main document.


----------

