Skip to content

Commit fdbef4c

Browse files
committed
frontend->3d navbar hover effect
1 parent 854c8dc commit fdbef4c

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<html>
2+
<head>
3+
<title> 3D Nav Bar Hover Effect </title>
4+
</head>
5+
<link rel="stylesheet" type="text/css" href="style.css">
6+
<body>
7+
<section class="container">
8+
<div><p>Home</p></div>
9+
<div><p>About</p></div>
10+
<div><p>Contact</p></div>
11+
<div><p>Blog</p></div>
12+
</section>
13+
</body>
14+
</html>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
*
2+
{
3+
margin: 0;
4+
padding: 0;
5+
box-sizing: border-box;
6+
background: #111;
7+
}
8+
.container
9+
{
10+
height: 400px;
11+
width: 250px;
12+
margin-left: auto;
13+
margin-right: auto;
14+
margin-top: 220px;
15+
}
16+
p
17+
{
18+
font-size: 30px;
19+
text-align: center;
20+
margin-top: 5px;
21+
cursor: pointer;
22+
color: #fff;
23+
width: 100%;
24+
background: #ea5455;
25+
border-radius: 10px;
26+
text-transform: uppercase;
27+
font-family: sans-serif;
28+
font-weight: 700;
29+
letter-spacing: 3px;
30+
}
31+
div
32+
{
33+
margin-left: auto;
34+
margin-right: auto;
35+
border-radius: 10px;
36+
width: 200px;
37+
height: 40px;
38+
margin-top: 6%;
39+
transition-duration: 0.2s;
40+
}
41+
p:hover
42+
{
43+
background: #fff;
44+
color: #111;
45+
}
46+
div:nth-child(even)
47+
{
48+
transform: perspective(300px) rotateY(45deg);
49+
box-shadow: -2px 2px 7px #fff;
50+
}
51+
div:nth-child(odd)
52+
{
53+
transform: perspective(300px) rotateY(-45deg);
54+
box-shadow: 2px 2px 7px #fff;
55+
}
56+
div:hover
57+
{
58+
transform: rotateY(0);
59+
box-shadow: 0 0 0;
60+
}
61+
62+
63+
64+

0 commit comments

Comments
 (0)