Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    CSS hover Pseudo-Class

    CSS hover Pseudo-Class adds special effects to an HTML element when the mouse pointer is brought over on that element.

    Syntax:

    selector:hover {
    /* declarations */
    }

    Here is an example of how this HTML element changes its background color when your mouse enters the area of ​​this element.

    Example:

    <!DOCTYPE html>
    <html>
    
        <head>
            <style>
                .box {
                    background-color: lemonchiffon;
                    width: 400px;
                    height: 120px;
                    margin: auto;
                    font-size: 30px;
                    padding: 5px;
                    border: 1px solid #edaf85;
                    border-radius: 14px;
                    text-align: center;
                }
                
                .box:hover {
                    background-color: honeydew;
                    border-color: #c8c8ff;
                }
            </style>
        </head>
    
        <body>
            <div class="box"> Bring your mouse over me to change my Color </div>
        </body>
    
    </html>


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.