Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Change button background on onmouseover/onmouseout
Old 04-21-2009, 11:17 AM Change button background on onmouseover/onmouseout
Novice Talker

Posts: 6
Trades: 0
Hello friends

if i've a button of the following code
Code:
<button type=submit name=s2>CLICK ME</button>
And its css

Code:
<style>
button
{
cursor:pointer;
color:#666;
FONT-FAMILY: 'Tahoma';
padding: 1px 2px;
background:url(1.gif) repeat-x left top;
}
</style>
I wanna make the following changes

if i've 1.gif and 2.gif ( images )

let the background be 1.gif

and
onmouseover will be 2.gif

and indeed
onmouseout will be 1.gif

How can i write it using css , cause i've tried million of time and it always gives me error

thanks in advance
manal_nor is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-21-2009, 03:36 PM Re: Change button background on onmouseover/onmouseout
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You need to put the button in as a BACKGROUND to the <a> tag.
Then you need to specify the 'rollover' image for the a:hover so that it will change when the mouse is over the link.

Like this:

a{background: images/1.gif no-repeat;}
a:hover{background: images/2.gif no-repeat;}
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Change button background on onmouseover/onmouseout
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11496 seconds with 12 queries