HomeОбразованиеRelated VideosMore From: Chidre'sTechTutorials

3. Creating Website Navigation Bars using HTML & CSS

25 ratings | 717 views
Creating Appealing Drop Down Navigation Bars - Example 1: Horizontal Navigation Bar Drop Down Navigation Bar Drop Down Menu Bar Fixed Navigation Bar Opaque Navigation Bar Example Code: must set background image then use code <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Third Navigation Bar</title> <style type="text/css"> body { border:0px solid red; margin:0px; background-image:url('fort_bg.jpg'); background-size:cover; } div#nav > ul#mainMenu { border:0px solid green; margin-top:0px; margin-bottom:0px; list-style-type:none; padding-left:0px; background-color:black; position:fixed; width:100%; } div#nav > ul#mainMenu > li { float:left; } div#nav > ul#mainMenu::after { content:" "; display:block; clear:left; height:1px; background-color:gray; } div#nav > ul#mainMenu > li:first-child { color:white; font-family:'monotype corsiva'; font-size:16pt; padding-right:15px; line-height:30px; border-right:1px solid gray; } div#nav > ul#mainMenu > li > a { text-decoration:none; color:white; background-color:black; width:100px; height:30px; display:inline-block; border-right:1px solid gray; text-align:center; line-height:30px; } div#nav > ul#mainMenu > li > ul.subMenu { list-style-type:none; padding-left:0px; height:0px; overflow:hidden; position:absolute; box-shadow:0px 0px 5px white; } div#nav > ul#mainMenu > li > ul.subMenu > li > a { text-decoration:none; color:white; background-color:rgba(0,0,0,0.5); width:100px; height:30px; display:block; border-top:1px solid gray; line-height:30px; padding-left:5px; } div#nav > ul#mainMenu > li:hover > ul.subMenu { height:90px; -webkit-animation: myAnimation 1s; } div#nav > ul#mainMenu > li > a:hover { background-color:orange; color:black; } div#nav > ul#mainMenu > li > ul.subMenu > li > a:hover { background-color:orange; color:black; } @-webkit-keyframes myAnimation { from {height:0px;} to{height:90px;} } </style> </head> <body> <div id="nav"> <ul id="mainMenu"> <li>Manjunath Chidre</li> <li><a href="#">WEB</a> <ul class="subMenu"> <li><a href="#">HTML</a></li> <li><a href="#">CSS</a></li> <li><a href="#">JavaScript</a></li> </ul> </li> <li><a href="#">GAME</a> <ul class="subMenu"> <li><a href="#">C#</a></li> <li><a href="#">Maya</a></li> <li><a href="#">Unity</a></li> </ul> </li> <li><a href="#">GRAPHICS</a> <ul class="subMenu"> <li><a href="#">Photoshop</a></li> <li><a href="#">Illustrator</a></li> <li><a href="#">Indesign</a></li> </ul> </li> </ul> </div> <br/><br/><br/> <br/><br/><br/> <br/><br/><br/> <br/><br/><br/> <br/><br/><br/> <br/><br/><br/> <br/><br/><br/> <br/><br/><br/> <br/><br/><br/> </body> </html> ======================================================== Follow the link for next video: https://youtu.be/t0U3LewjhVw Follow the link for previous video: https://youtu.be/edt4QC0qTcc ========================================================
Html code for embedding videos on your blog
Text Comments (5)
Chidre'sTechTutorials (2 months ago)
SUBSCRIBE, SHARE & SUPPORT: https://www.youtube.com/chidrestechtutorials VISIT & LEARN AT FREE OF COST: ​https://www.chidrestechtutorials.com
sonia duhan (2 months ago)
Sir I have use same coding But it's body border color are on full screen not an particular area
Chidre'sTechTutorials (1 month ago)
Plz paste your code here. Then we can give solution.
Neymar Jr (1 year ago)
When u apply position absolute...how main menu background colour removed
Ram Naidu (1 year ago)
in this tutoriali learn how to create the dropdown menus and how we can apply the styles to dropdowns.....tqs fr the everything sir...

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.