HTML CSS examples for CSS Layout:Position
Navigation Bar - Search box - moves position when resize browser
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> html {<!--from w w w. ja v a 2 s.c om--> background:yellow; width:100%; } nav { background:blue; height:3.4em; width:100%; } ul, li { margin:0; padding:0; list-style:none; font-size:2.41em; } li { display:inline-block; } ul { background:purple; width:100%; } li a { display:block; line-height:3em; padding:0 2.3em; color:Chartreuse; text-decoration:none; } li a:hover { background:blue; height:3em; padding-top:.4em; position:relative; text-decoration:underline; top:-.4em; border-radius:.4em .4em 0 0 } .current, a:hover.current { background:blue; color:yellow; padding-top:.4em; position:relative; top:-.4em; border-radius:.4em .4em 0 0; border-bottom:solid blue; cursor:default; } .button { background:blue; color:pink; padding:0 2em; height:3.5em; display:table; border:2px solid OrangeRed; font-family:Helvetica, Times New Roman; font-weight:100; font-size:.86em; letter-spacing:.46em; line-height:3.5em; text-align:center; text-decoration:none; white-space:nowrap; cursor:pointer; border-radius:.326em; -webkit-box-shadow:inset 0px 2px 4px grey; box-shadow:inset 0px 2px 4px BlueViolet; background:Chartreuse; } #formbox div { display:inline-block } </style> </head> <body> <ul class="nav"> <li> <a href="../index.cfm" title="Home" class="current">Lore</a> </li> <li> <a href="../ar.cfm" title="Sell Here">Lorem i</a> </li> <li> <a href="../aboutus.cfm" title="About Us">Lorem ip</a> </li> <li> <a href="../rlist.cfm" title="A List">Lorem </a> </li> <li> <a href="../faq.cfm" title="FAQ">Lor</a> </li> <li> <form id="formbox"> <div id="searchbox"> <input type="text" value="search word here.." style="font-size: 14pt" name="searchbox" size="36em" onfocus="setValue(this)" onblur="setValue(this)"> </div> <div id="button"> <input type="submit" value="Find!"> </div> <div id="signin"> <a href="search.cfm">Lorem ip</a> </div> </form> </li> </ul> </body> </html>