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 an animated navbar menu hover effect using only HTML & CSS.
Direction-aware menu bottom line hover effect with few lines of CSS code.
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>Nav Menu Hover Effect</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div class="links" style="--items: 5;">
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Gallery</a>
<a href="#">Blog</a>
<a href="#">Contact</a>
<span class="line"></span>
</div>
</header>
</body>
</html>
CSS
@import url('https://fonts.googleapis.com/css?family=Inconsolata|Lato:300,400,700');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Lato', sans-serif;
outline: none;
border: none;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #345;
}
header {
overflow: hidden;
}
.links {
display: grid;
grid-template-columns: repeat(var(--items), 1fr);
position: relative;
background-color: #0b151f;
font-weight: 300;
}
.links a {
font-size: 2em;
color: #425a72;
padding: .75em;
text-align: center;
text-decoration: none;
transition: all 0.5s;
}
.links a:hover {
color: #adf;
}
.links .line {
background-color: #adf;
height: 1px;
pointer-events: none;
opacity: 0;
transition: all 0.5s cubic-bezier(1, 2, 0.2, 0.6);
position: absolute;
bottom: 0;
left: var(--left, calc(100%/var(--items) * (var(--index) - 1)));
width: var(--width, calc(100% / var(--items)));
--index: 0;
}
.links a:hover~.line {
opacity: 1;
}
.links a:nth-of-type(1):hover~.line {
--index: 1;
}
.links a:nth-of-type(2):hover~.line {
--index: 2;
}
.links a:nth-of-type(3):hover~.line {
--index: 3;
}
.links a:nth-of-type(4):hover~.line {
--index: 4;
}
.links a:nth-of-type(5):hover~.line {
--index: 5;
}
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.
nice
ReplyDeleteWonderful 😊
ReplyDelete