Solved

Using CSS to set a button color when not hovering

Posted on 2014-04-14
2
316 Views
Last Modified: 2014-04-14
Hi
I was given the following code to change the back color of a button on mouse hover.
What other css code would I use to change the color to white when there is no mouse hover

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
.myHoverButton:hover { background-color: #9999ff; }
</style>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    <button id="button1" class="myHoverButton">Submit</button>

    </div>
    </form>
</body>
</html>
0
Comment
Question by:murbro
2 Comments
 
LVL 5

Accepted Solution

by:
jayakrishnabh earned 500 total points
Comment Utility
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
.myHoverButton {
            background-color: white !important;
        }
        .myHoverButton:hover {
            background-color: #9999ff;            
        }  
</style>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    <button id="button1" class="myHoverButton">Submit</button>

    </div>
    </form>
</body>
</html>
0
 

Author Closing Comment

by:murbro
Comment Utility
Great. Thanks very much
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now