We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message
Contact Forum Editor

Send an email to our Forum Editor:


PLEASE NOTE: Your name is used only to let the Forum Editor know who sent the message. Both your name and email address will not be used for any other purpose.

Tech Helproom


It's free to register, to post a question or to start / join a discussion


 

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


Bansaw

Likes # 0

I want two link styles on the same page.
In my CSS file, I have already:
[code]
a:hover
{
Color : white;
Background-color : #3333ff;
}
[/code]
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:
[code]
.imagelinkclass
{

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

}[/code]
But didn't work.

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

Any ideas?

Like this post
DarCol

Likes # 0

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.

Like this post
Posix

Likes # 0

You could just do (in your css document):

img { border: 0; }

This would apply to all images in the page.

Like this post

Reply to this topic

This thread has been locked.



IDG UK Sites

iPad Air 2 release date, price, specs, new features: world's thinnest tablet also gets Touch ID

IDG UK Sites

Why you shouldn't buy the iPad mini 3: No wonder Apple gave it 10 seconds of stage time

IDG UK Sites

Will Photoshop work with Yosemite? And will Illustrator, After Effects, Premiere Pro or the other A?......

IDG UK Sites

Should I upgrade from Mavericks to OS X 10.10 Yosemite? What you need to know before updating to...