In this video, we will create an awesome text effect CSS only. This video on how to clip image on text using -webkit-background-clip. For a preview click on Demo If you want to get the complete source code in a zip file then click the "Fork me on GitHub" button below that will redirect you to my GitHub account where you found all my source code files. Copy Code(select code part and copy using "CTRL + C" or using R Click to mouse)🡇 HTML <! DOCTYPE html > < html lang = "en" > < head > < meta charset = "UTF-8" > < meta http-equiv = "X-UA-Compatible" content = "IE=edge" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < title >How to clip image on text</ title > <!-- style.css --> < link rel = "stylesheet" href = "style.css" > </ head > < body >
In this video, we will create a hover animated GIF using HTML & CSS. When we hover on the image box the image change into a GIF image. You can easily create this with only CSS.
For a preview click on Demo
If you want to get the complete source code in a zip file then click the "Fork me on GitHub" button below that will redirect you to my GitHub account where you found all my source code files.
Copy Code(select code part and copy using "CTRL + C" or using R Click to mouse)🡇
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Play GIF on hover</title>
<!-- style -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="play-on-hover"></div>
<h1>Hover Me</h1>
</body>
</html>
CSS
@import url('https://fonts.googleapis.com/css2?family=Raleway&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Raleway', sans-serif;
}
body {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #e1fbff;
}
.play-on-hover {
width: 40vw;
height: 50vh;
background-image: url(static.jpg);
background-size: cover;
cursor: pointer;
border-radius: 10px;
box-shadow: 0 10px 20px -5px #ccc;
}
.play-on-hover:hover {
background-image: url(animated.gif);
}
h1 {
font-size: 5em;
color: #085863;
margin-top: 50px;
}
Fork me on GitHub
Click on download zip to download complete source in zip file.
Subscribe to me on YouTube
Like & Comment on my video on YouTube & press the bell icon to get notification first.
Follow me on Instagram
Comment down any query if you have.
Does it work
ReplyDeleteyes
Delete