I am using a script in the scripting archive to change stylesheets with a dropdown menu. I have a logo on my site that I want to change color with the different chosen styles. How can I change the image with CSS?![]()
I am using a script in the scripting archive to change stylesheets with a dropdown menu. I have a logo on my site that I want to change color with the different chosen styles. How can I change the image with CSS?![]()
Huh? What image? With css?
With JS it's easy:
Code:<img src="image1.png" onmouseover="src = 'image2.png'" onmouseout="src = 'image1.png'">
- Mike
You need to create multiple versions of the image to begin with. From there you apply the image as a background on a div(or equivalent) like so.I am going to assume you have a basic understanding of CSS. If not then I suggest you find a quick tutorial.
with html like thisCode:#logo{ background: #FFF url('somegif.gif') center top no-repeat; }
Then just change the style in the alternate sheet.Another option is to use transparency(gif or png) in the image. Then set the background-color: property correctly.Code:<div id="logo"></div>
I tried that but the the image won't appear on the second style. Only on the default style.
Bookmarks