Jump to content

Hover Properties with Same Selector


caleb1
 Share

Recommended Posts

Does anyone know if there is a way to set properties to an element when it is hovered over using the same selector as the proporties for when it is not hovered over?  For example something like:

.myclass {
	background-color:green;
	background-color:hover:blue; (or something like that)
}

Rather than:

.myclass {
	background-color:green
}

.myclass:hover {
	background-color:blue
}

Thanks,

Link to comment
Share on other sites

This seems.... specific. Are you looking for a shorthand notation?

Or does this relate to another project. Happy to go through any part of how the CSS works in this case.

 

I'm not aware of any alternate forms of styling with attributes/pseudo-selectors.

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...