Solved

ASP.net using two  CSS styles on one button

Posted on 2014-04-14
3
1,174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

737 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