- No ability to connect styles
- There is no way to insert styles between
<style> </style>
<div style="background: #333; padding: 10px;">Dark gray</div>
How to prescribe him a "hover", for example background: #555; right inside style="" ?
<style> </style><div style="background: #333; padding: 10px;">Dark gray</div>
How to prescribe him a "hover", for example background: #555; right inside style="" ?
Pseudo-class selectors cannot be described directly in the tag. If there is no possibility to connect styles, use the onmouseover and onmouseout .
<div style="background: #333; padding: 10px;" onmouseover="this.style.backgroundColor='#555';" onmouseout="this.style.backgroundColor='#333';"> Dark gray </div> No, hover is a pseudo-class.
And on w3.org it is written that you can: https://www.w3.org/TR/2002/WD-css-style-attr-20020515
Setting properties for a dynamic states, using pseudo-classes:
<a href="http://www.w3.org/" style="{color: #900} :link {background: #ff0} :visited {background: #fff} :hover {outline: thin red solid} :active {background: #00f}">...</a> Source: https://ru.stackoverflow.com/questions/229879/
All Articles