Solved

ASP.net using two  CSS styles on one button

Posted on 2014-04-14
3
1,171 Views
Last Modified: 2014-04-14
Hi

I am trying to use the following code to ensure that one button changes color
on mouse hover and is left justified but I noticed that you can only specify one CSSClass
name    <button id="button10"  class="myHoverButton">Submit</button>
How do I adjust the following code so that both the mouse hover and the left justification
can be applied to one button?

    <style type="text/css">
        .style1
        {
            height: 34px;
        }
        .myHoverButton:hover { background-color: #9999ff; }
        .btnstyle {
            text-align:left;
            }
    </style>
0
Comment
Question by:murbro
3 Comments
 
LVL 5

Accepted Solution

by:
jayakrishnabh earned 300 total points
ID: 39998718
<style type="text/css">
        .style1
        {
            height: 34px;
        }
        .myHoverButton:hover {
          background-color: #9999ff;
         
        }
        #button10 {
            text-align:left;
            }
    </style>
0
 
LVL 14

Assisted Solution

by:Dustin Hopkins
Dustin Hopkins earned 200 total points
ID: 40000079
You can specify multiple classes to html elements, it is in fact how many frameworks such as twitter bootstrap work.
So to add multiple do this, you can add as many as you want:
<button id="button10"  class="myHoverButton btnstyle">Submit</button>

Open in new window


Hope this helps,
Dustin
0
 

Author Closing Comment

by:murbro
ID: 40000120
Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …

839 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