Flat Navigation
How do I make an flat navigation?
Inspired by Asif Aleem's work on Dribbble http://drbl.in/ieQh. What is a flat navigation? How do you make a flat navigation? This script and codes were developed by Mojtaba Seyedi on 27 July 2022, Wednesday.
Flat Navigation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flat Navigation</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { background-color: #1b1b1b;
}
nav { width : 330px; margin: 0 auto;
}
menu:after , menu:before { display : table; content : ' ';
}
menu:after { clear : both;
}
li { background-color : #fff; list-style-type: none; float : left; margin-right : 1px;
}
li a { position: relative; display : block; text-align : center; text-decoration: none; width : 62px; height : 66px;
}
a span { display : block; font-size : 32px; padding : 20px 15px; color : #222; position: absolute; top : 0; left : 0; z-index : 100; transition : all .2s;
}
a:before { display: block; content : ' '; position: absolute; transition : all .2s;
}
a:hover span { color : #fff; transition : all .2s;
}
a:hover:before { transition : all .3s;
}
.c1:before{ background-color: #b651d8;
}
.c2:before { background-color: #71c55e;
}
.c3:before { background-color: #fab904;
}
.c4:before { background-color: #e94739;
}
.c5:before { background-color: #407ded;
}
hr { width : 100px; margin : 50px auto;
}
/* Top
********************/
nav.top
a:before { top : 0; left : 0; height : 5px; width : 100%;
}
nav.top
a:hover:before { height : 100%;
}
/* left
********************/
nav.left
a:before { top : 0; left : 0; height : 100%; width : 5px;
}
nav.left
a:hover:before { width : 100%;
}
/* bottom
********************/
nav.bottom
a:before { bottom : 0; left : 0; height : 5px; width : 100%;
}
nav.bottom
a:hover:before { height : 100%;
}
/* right
********************/
nav.right
a:before { top : 0; right : 0; width : 5px; height : 100%;
}
nav.right
a:hover:before { width : 100%;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <nav class="top"> <menu> <li> <a class="c1" href="#" > <span>☀</span> </a> </li> <li> <a class="c2" href="#" > <span>✈</span> </a> </li> <li> <a class="c3" href="#" > <span>❄</span> </a> </li> <li> <a class="c4" href="#" > <span>☎</span> </a> </li> <li> <a class="c5" href="#" > <span>✉</span> </a> </li> </menu>
</nav>
<hr />
<nav class="left"> <menu> <li> <a class="c1" href="#" > <span>☀</span> </a> </li> <li> <a class="c2" href="#" > <span>✈</span> </a> </li> <li> <a class="c3" href="#" > <span>❄</span> </a> </li> <li> <a class="c4" href="#" > <span>☎</span> </a> </li> <li> <a class="c5" href="#" > <span>✉</span> </a> </li> </menu>
</nav>
<hr />
<nav class="bottom"> <menu> <li> <a class="c1" href="#" > <span>☀</span> </a> </li> <li> <a class="c2" href="#" > <span>✈</span> </a> </li> <li> <a class="c3" href="#" > <span>❄</span> </a> </li> <li> <a class="c4" href="#" > <span>☎</span> </a> </li> <li> <a class="c5" href="#" > <span>✉</span> </a> </li> </menu>
</nav>
<hr />
<nav class="right"> <menu> <li> <a class="c1" href="#" > <span>☀</span> </a> </li> <li> <a class="c2" href="#" > <span>✈</span> </a> </li> <li> <a class="c3" href="#" > <span>❄</span> </a> </li> <li> <a class="c4" href="#" > <span>☎</span> </a> </li> <li> <a class="c5" href="#" > <span>✉</span> </a> </li> </menu>
</nav>
</body>
</html>
Flat Navigation - Script Codes CSS Codes
body { background-color: #1b1b1b;
}
nav { width : 330px; margin: 0 auto;
}
menu:after , menu:before { display : table; content : ' ';
}
menu:after { clear : both;
}
li { background-color : #fff; list-style-type: none; float : left; margin-right : 1px;
}
li a { position: relative; display : block; text-align : center; text-decoration: none; width : 62px; height : 66px;
}
a span { display : block; font-size : 32px; padding : 20px 15px; color : #222; position: absolute; top : 0; left : 0; z-index : 100; transition : all .2s;
}
a:before { display: block; content : ' '; position: absolute; transition : all .2s;
}
a:hover span { color : #fff; transition : all .2s;
}
a:hover:before { transition : all .3s;
}
.c1:before{ background-color: #b651d8;
}
.c2:before { background-color: #71c55e;
}
.c3:before { background-color: #fab904;
}
.c4:before { background-color: #e94739;
}
.c5:before { background-color: #407ded;
}
hr { width : 100px; margin : 50px auto;
}
/* Top
********************/
nav.top
a:before { top : 0; left : 0; height : 5px; width : 100%;
}
nav.top
a:hover:before { height : 100%;
}
/* left
********************/
nav.left
a:before { top : 0; left : 0; height : 100%; width : 5px;
}
nav.left
a:hover:before { width : 100%;
}
/* bottom
********************/
nav.bottom
a:before { bottom : 0; left : 0; height : 5px; width : 100%;
}
nav.bottom
a:hover:before { height : 100%;
}
/* right
********************/
nav.right
a:before { top : 0; right : 0; width : 5px; height : 100%;
}
nav.right
a:hover:before { width : 100%;
}
Developer | Mojtaba Seyedi |
Username | seyedi |
Uploaded | July 27, 2022 |
Rating | 4 |
Size | 2,707 Kb |
Views | 38,456 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Centering anything horizontally | 2,018 Kb |
Shader Menu | 2,784 Kb |
Covering Bad | 3,891 Kb |
Toggle menu | 2,279 Kb |
Bell alert | 1,980 Kb |
Hidden navigation | 4,330 Kb |
Menu | 3,077 Kb |
Navigation | 3,699 Kb |
Flock Login | 3,145 Kb |
Single element cloud | 2,316 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS Social Media Icon | TychoBlender | 3,871 Kb |
Donut Chart example - MorrisJS | Capelo | 2,385 Kb |
LeMandinque | Aadesida | 9,046 Kb |
Canvas Orbital Trails v2 | Jackrugile | 3,421 Kb |
Svg penguin | _massimo | 2,990 Kb |
Button Option Group | Honchoman | 1,859 Kb |
Boom | Mhrjnsa1 | 1,794 Kb |
CSS eye follow | Pedrocampos | 2,592 Kb |
Css3 slide | Nakome | 3,190 Kb |
Wikipedia Viewer | Odylic | 2,333 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!