The hyperlinks in my page are red. I am using a div tag to put up some text, and there are a few hyperlinks there. I want to use different color in that div, how can I do it? My css is more or less like this: Then I use a <div align=center class="style"> with Is this correct? What do I need to add to have the hyperlinks in the div show a different color?
i think u can set a few style like .a { bla bla } .b { bla bla } then inside the <a> tag it goes like this: <a href="x.html" class="a">link1 red</a> <a href="y.html" class="b">this is diffirent color</a> correct me if im wrong .. im not very sure about this.
Yeah, I read something like that, but what I want to do is have the coop ad's text in a different color, and I can't see any href there.
You can also do this a { text-decoration: none; border-bottom: 1px solid red; color: Lime; } Code (markup): which makes the links show with lime text and a red underline, mmm, not pretty! Sarah
Yup, but that will change the color on all the links on my page, I want to change just the coop ones, which are inside the div.
may be u should try to set the color of the co-op link in the BODY then whatever links u want you could set another style and using the <a href="x.html" class="a">
That's what I ended up doing, but there MUST be a way to do that in the div, the other way is too complicated, you have to style every single href on your page.
Remember an element can have more than one class. div.style { font-family: verdana; font-size: 2mm; color: #FFCC66 } div.box a:link, div.box a:visited { color: #3C3C3C; text-align: center; margin-left: 45px; } div.box a:hover, div.box a:active { color: #FF0000; text-decoration: none; margin-left: 45px; } Code (markup): and then <div class="style box"> Code (markup):
Not a CSS expert but can't you call one class say 'nav' and one 'body' and then go nav.a { stuff here} body.a {other colour and stuff here}
dont know if this helps but i have this which does all the hyperlinks in a cell... could 'td' could be substituted for div? (i read 'hover' has to be on a seperate line ) <td class="tablez15" width="69"> #tablez15 td {background-image: url(pics/bgb.gif); background-repeat: repeat; font-size: 13px; font-family: verdana; font-weight: bold; text-align: center; vertical-align: top; line-height: 18px;} #tablez15 a:link, #tablez15 a:visited, #tablez15 a:active { color: #000080 } #tablez15 a:hover { color: #C0C0C0 }