Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (ajprincess):

pls help:)

OpenStudy (ajprincess):

how to change the color of this image to brown on hover using css.

OpenStudy (ajprincess):

@ganeshie8 @e.mccormick

ganeshie8 (ganeshie8):

@Preetha

OpenStudy (ajprincess):

@annas

OpenStudy (anonymous):

<style type="text\css"> #element_id:hover{ color=SaddleBrown; } </style> I used SaddleBrown instead of normal brown because on my screen normal brown looks more red. here's a list of the named colors and what they look like. You can also use hex values or RGB() or RGBA() to set color and transparency w3schools.com can explain all of that for you if you're interested

OpenStudy (ajprincess):

where should i call this? in the image tag?

OpenStudy (ajprincess):

@seandisanti

OpenStudy (anonymous):

While you can do it inline, within the tag, convention and best practices say that it should be done separately in a style tag as demonstrated, or completely off page in a linked css file. Also keep in mind, while the posted sample will change the color property of the element with the id specified, images are images, the color property may not do what you think it will. check out http://www.w3schools.com/cssref/default.asp for a list of properties and their acceptable values.

OpenStudy (ajprincess):

thanx. isn't there anyway for me to change the color.

OpenStudy (ajprincess):

i mean any other way. xos i tried so many methods. bt nothing seem to work fine

OpenStudy (anonymous):

typically 'color' refers to foreground color, or text. you also have background color etc, but your image is going to be covering the background so that doesn't work really well either. What I typically do would be to put the image on a colored div of the same size, and then on hover adjust the opacity and border of the image. having it turn slightly transparent gives the illusion of the color behind it being added. Here is a mock up page I did for a friend that does the opposite, by starting with a lowered opacity image, and then setting the opacity to full http://seandisanti.com/ctm/index.php

OpenStudy (ajprincess):

Thnx a lot.:)

OpenStudy (anonymous):

no problem, i'm glad to help

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!