Is it possible to have pseudo-classes using inline styles?
Example:
<a href="http://www.google.com" style="hover:text-decoration:none;">Google</a>
I know the above HTML won't work but is there something similar that will?
P.S. I know I should use an external style sheet, and I do. I was just curious if this could be done using inline styles.
This question is related to
html
css
css-selectors
pseudo-class
inline-styles
Not CSS, but inline:
<a href="#"
onmouseover = "this.style.textDecoration = 'none'"
onmouseout = "this.style.textDecoration = 'underline'">Hello</a>
You could try https://hacss.io:
<a href="http://www.google.com" class=":hover{text-decoration:none;}">Google</a>
Rather than needing inline you could use Internal CSS
<a href="http://www.google.com" style="hover:text-decoration:none;">Google</a>
You could have:
<a href="http://www.google.com" id="gLink">Google</a>
<style>
#gLink:hover {
text-decoration: none;
}
</style>
or you can simply try this in inline css
<textarea style="::placeholder{color:white}"/>
Source: Stackoverflow.com