Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I currently have a hover effect on a div using CSS (code below) how do I make the effect occur on hover and on click.

I believe its using .hover as well as using .active but how would I use them together on the CSS code below.

.maincontentdiv:hover > .slideup {
min-height: 50%;
}
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

In CSS

.maincontentdiv:active > .slideup, .maincontentdiv:hover > .slideup { 
   min-height: 50%;
}

Is equal to click event. Set same properties for more than one object, by seperating it using , sign. It is used to seperate each query in the CSS selector.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.