HTML CSS examples for CSS Widget:Nav Bar
Build the custom navigation bar
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .nav ul {<!--from w w w. j a va 2 s. com--> list-style:none; background-color:Chartreuse; text-align:center; padding:0; margin:0; } .nav li { font-family:'Oswald', sans-serif; font-size:2em; line-height:41px; height:41px; border-bottom:2px solid yellow; } .nav a { text-decoration:none; color:blue; display:block; transition:.4s background-color; } .nav a:hover { background-color:pink; } .nav a.active { padding:0 0 0 0; } @media screen and (min-width: 600px) { .nav li { padding:0 16px 0 0; border-bottom:none; height:41px; line-height:41px; font-size:2em; } .nav li { display:inline-block; vertical-align:middle; margin-right:-5px; } </style> </head> <body> <div class="nav"> <ul> <li class="home"> <a href="#"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" height="40px"> </a> </li> <li class="tutorials"> <a href="#">Lorem ipsum dolor sit am</a> </li> <li class="about"> <a href="#">Lorem ipsum </a> </li> <li class="news"> <a href="#">Lorem ipsu</a> </li> <li class="contact"> <a href="#">Lore</a> </li> </ul> </div> </body> </html>