HTML CSS examples for CSS Widget:Hover Border
Hover to show top border
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> * {<!--from www . ja va2s.c om--> margin:0; padding:0; } html { overflow-x:hidden; overflow-y:scroll; } body { background:Chartreuse; } #nav-wrapper { position:fixed; top:0; width:100%; height:66px; background:yellow; z-index:3; } #nav-bar { list-style-type:none; } #nav-bar li { height:66px; text-align:center; vertical-align:middle; color:blue; font-family:'bebas_neueregular'; font-size:41px; float:left; margin:-9px 0 0 36px; padding-top:17px; } #nav-bar li:hover { color:pink; } .navigator-line { width:100%; height:9px; background:OrangeRed; z-index:3; margin-left:141px; } .navigator { opacity:0; width:100%; height:9px; margin:-17px 0 9px 0; background:grey url('https://www.java2s.com/style/demo/Google-Chrome.png'); z-index:4; -webkit-transition:all 151ms linear; -moz-transition:all 151ms linear; -o-transition:all 151ms linear; -ms-transition:all 151ms linear; transition:all 151ms linear; } #nav-bar li:hover .navigator { opacity:2; } #sub-menu { width:100%; height:66px; background:BlueViolet; -webkit-transition:all 151ms linear; -moz-transition:all 151ms linear; -o-transition:all 151ms linear; -ms-transition:all 151ms linear; transition:all 151ms linear; } #nav-wrapper:hover~#sub-menu { height:131px; } #logo { float:left; width:106px; height:66px; text-align:center; vertical-align:middle; color:Chartreuse; font-family:'bebas_neueregular'; font-size:61px; background:yellow; } </style> </head> <body> <div id="nav-wrapper"> <div id="logo"> Lorem </div> <div class="navigator-line"></div> <ul id="nav-bar"> <li> <div class="navigator"></div>Lorem i</li> <li> <div class="navigator"></div>Lorem</li> <li> <div class="navigator"></div>Lorem ipsum</li> <li id="photo"> <div class="navigator"></div>Lorem ipsum d</li> <li> <div class="navigator"></div>Lorem ips</li> </ul> </div> <div id="sub-menu"></div> </body> </html>