Solved

ASP.net using two  CSS styles on one button

Posted on 2014-04-14
3
1,164 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
Comment Utility
<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
Comment Utility
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
Comment Utility
Thanks
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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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.…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

12 Experts available now in Live!

Get 1:1 Help Now