a:hover and having two link styles...?

  Bansaw 22:02 PM 28 Sep 10

I want two link styles on the same page.
In my CSS file, I have already:
Color : white;
Background-color : #3333ff;
This works fine for regular text links.
However, I want to have an image link somewhere and for an image it looks bad becuse it highlights the image with a blue box around it.

How can I have a separate class for the image?
I already did this:

a:link color: #FFFF00;
a:visited color: #9966CC;
a:hover color: #CCCCCC;
a:active color: #FF0000;

But didn't work.

Does the a:hover just overrride everything I do?
In my HTML I have:
a href="ImagesPromo/PlayDemo.html" class="imagelinkclass"> img src="ImagesPromo/picts/Reflected.png" border="0" align="middle"> /a>[/code]

Any ideas?

  DarCol 18:35 PM 04 Oct 10

use this code tu test your border, here is at 5px in color black, solid fill.

<a href="ImagesPromo/PlayDemo.html">
<img src="ImagesPromo/picts/Reflected.png" style="border:5px solid black" width="100" height="100" /></a>

And if you dont's want border use this:

<a href="ImagesPromo/PlayDemo.html">
<img src="ImagesPromo/picts/Reflected.png" style="border:0px" width="100" height="100" /></a>

The border tag, is deprecated, and is not supported in HTML 4.01 Strict / XHTML 1.0 Strict DTD.

Use CSS instead. For that versions and HTML5.

You could just do (in your css document):

img { border: 0; }

This would apply to all images in the page.


This thread is now locked and can not be replied to.

Microsoft Surface Pro 4 review: Hands-on with the new generation of Surface

1995-2015: How technology has changed the world in 20 years

Crowdfunding for world’s first 3D camera-computer found in 30 hours

2015 iMac release date rumours, specs, price & features: new 21in 4K Retina iMacs coming next week