Home › CSS Tutorial › Pseudo-classes
Pseudo-classes
Style a state.
Examples: :hover, :focus, :first-child, :nth-child(n), :not(), :checked.
Example code
<style>
button:hover{background:gold}li:first-child{font-weight:700}li:nth-child(odd){color:teal}
input:focus{outline:3px solid orange}
</style>
<button>Hover</button><ul><li>One</li><li>Two</li><li>Three</li></ul><input placeholder='Focus me'>