Solved

CSS hover not working...

Posted on 2014-07-26
4
267 Views
Last Modified: 2014-07-26
When I change the css to:
#btn1      <-- remving :hover
{
.
.
}

I can see the effect of hover setting. But with the followings, it doesn't work:
#btn1: hover    
{
.
.
}
.btns: hover      <-- after adding class="btns" to the controls
{
.
.
}

Question: How can I make the hover work?

Thank you.

#btn1: hover
{
  background: #7bb9e0;
  background-image: -webkit-linear-gradient(top, #7bb9e0, #4fa5db);
  background-image: -moz-linear-gradient(top, #7bb9e0, #4fa5db);
  background-image: -ms-linear-gradient(top, #7bb9e0, #4fa5db);
  background-image: -o-linear-gradient(top, #7bb9e0, #4fa5db);
  background-image: linear-gradient(to bottom, #7bb9e0, #4fa5db);
  text-decoration: none;
}

Open in new window

0
Comment
Question by:Mike Eghtebas
  • 2
  • 2
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40221687
No space between the : and the hover

#btn1:hover
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 40221702
Thanks.

#btn1:hover works.

because I have multiple buttons,
#btn1, #btn2:hover    doesn't work.

do I have to add hove to each on of them?

#btn1:hover, #btn2:hover  

I tried:
.btns:hover but it didn't work.

MIke
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40221714
Yes you need to add it to each one as they are seperate classes

#btn1:hover, #btn2:hover
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 40221723
Thanks Gary. There is also another question at:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_28484516.html

If you couple of minutes to take a look at.

Mike
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

785 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