karim
karim

Reputation: 25

What can I do for my images on site to be hidden instead of removed?

I am working on a project and I have some images on web site. When I move mouse and hover over these, they get removed but I want them to be hidden.

<!DOCTYPE HTML>

<html>

<head>
    <style>
        body {
            background: #ffff00 content-box;
            padding:10px;
        }
        
        img { 
            border-style: solid;
            border-color: black;
            border-width: 1px;
            padding: 10px;
            border-radius: 5px;
            box-sizing: content-box;
            width: 200px;
            height: 200px;
            box-sizing: content-box;
        }
        
        img:hover {
            display: none;
            padding: 0px;
            width: 120px;
            height: 120px;
            box-sizing: content-box;
            box-shadow: #ff0015 inset;
        }
    </style>

</head>

<body><img src="7.PNG" alt="ALI"><img src="8.jpg" alt="MOH"><img src="9.jpg" alt="KARIM"></body>

</html>

Upvotes: 0

Views: 43

Answers (1)

Alejandro Lariccia
Alejandro Lariccia

Reputation: 369

I don't understand what are you trying to do, do you want hide the image in his hover without removing it? maybe this works for you using the opacity property:

<!DOCTYPE HTML>

<html>

<head>
    <style>
        body {
            background: #ffff00 content-box;
            padding:10px;
        }
        
        img { 
        border-style: solid;
            border-color: black;
             border-width: 1px;
            padding: 10px;
            border-radius: 5px;
            box-sizing: content-box;
            width: 200px;
            height: 200px;
            box-sizing: content-box;
        }
        
        img:hover {
            opacity: 0;
            width: 120px;
            height: 120px;
            box-sizing: content-box;
            box-shadow: #ff0015 inset;
        }
    </style>

</head>

<body><img src="7.PNG" alt="ALI"><img src="8.jpg" alt="MOH"><img src="9.jpg" alt="KARIM"></body>

</html>

Upvotes: 2

Related Questions