different css code for links on different parts of the page

  • dr nick
  • Proficient
  • Proficient
  • dr nick
  • Posts: 263
  • Loc: Frankfurt

Post 3+ Months Ago

Hi,

I'm sure I've seen this explained in here somewhere before, but I just can't find it.

I'm looking to set different styles for the links at different parts of the page using css. How do I do that?

Also...I want images that are links not to have any kind of "link highlighted" border. How do I change that using css or some other means?

Thanks for any help!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

You can create different classes of links using css and then set the class inside the a tag. To remove the border around link images set the border attribute to 0 inside the img tag or give the image tags that you are using as links a css class that has the css border property set to "none" as in the examples below.



Code: [ Select ]
<html>
<head>
<style type="text/css">
a.bigRed
{
color: red;
font-size: 2 em;
}
a.bigRed:hover
{
color: black;
}
img.noBorder
{
border: none;
}
</style>
</head>
<body>
<a href="#" class="bigRed">blah</a><br>
<a href="#" ><img border="none" src="email.gif"></a>
or
<a href="#" ><img class="noBorder" src="email.gif"></a>
</body>
</html>
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. a.bigRed
  5. {
  6. color: red;
  7. font-size: 2 em;
  8. }
  9. a.bigRed:hover
  10. {
  11. color: black;
  12. }
  13. img.noBorder
  14. {
  15. border: none;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <a href="#" class="bigRed">blah</a><br>
  21. <a href="#" ><img border="none" src="email.gif"></a>
  22. or
  23. <a href="#" ><img class="noBorder" src="email.gif"></a>
  24. </body>
  25. </html>
  • dr nick
  • Proficient
  • Proficient
  • dr nick
  • Posts: 263
  • Loc: Frankfurt

Post 3+ Months Ago

Thanks RichB!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 100 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.