Solved

ASP.net using two  CSS styles on one button

Posted on 2014-04-14
3
1,175 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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