Clarence
Clarence

Reputation: 13

CSS- why is my hover effect is not working?

I have set a hover effect in my CSS, but it seems to be having no effect. What am I doing wrong?

#place-img-sentosa {
    background-image: url(images/sentosa.jpg);
    background-size: cover;
}

#place-img-sentosa:hover {
    background-color: aliceblue;
}

<div class="place">
        <div class="place-session">
            <div class="place-img" id="place-img-sentosa">
            </div>
            <h4>Take a walk to Sentosa Island</h4>
            <h5>With its pristine beaches, exciting attractions and tropical landscapes, the State of Fun is sure to
                leave you spellbound.</h5>
        </div>

Upvotes: 1

Views: 54

Answers (1)

Schquestoning
Schquestoning

Reputation: 449

The background image will still be covering the specified background color when hovering. set background image to none when hovering to solve the problem.

Upvotes: 2

Related Questions