9. Pseudo-classes: hover and focus
इस लेख का अनुवाद अपने आप होगा। अभी अंग्रेज़ी में दिखाया जा रहा है।
A pseudo-class styles an element in a particular state. :hover applies while the mouse is over an element. :focus applies when the element is selected with the keyboard. :first-child picks the first child.
Always style :focus too, so keyboard users can see where they are.
उदाहरण देखें
a:hover {
text-decoration: underline;
}
button:focus {
outline: 3px solid orange;
}
✍️ अब आपकी बारी
Make .btn change its background to orange when hovered.