Solved

CSS hover not working...

Posted on 2014-07-26
4
264 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

920 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

17 Experts available now in Live!

Get 1:1 Help Now