Jump to content
Sign in to follow this  
caleb1

Hover Properties with Same Selector

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,

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...