html - menu bar shrink when i restore down browser -



html - menu bar shrink when i restore down browser -

here seek create menu ... menu seems fine when browsers in maximize , seems image1

but when restore downwards browser menu image 2

code

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>gatr enterprise - home</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script src="js/mymenu1.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="css/style.css" /> <script type="text/javascript"> <!-- function text_newsletter_onclick() { } // --> </script> <style type="text/css"> .style1 { width: 100%; } </style> </head> <body> <div class="wrapper2"> <ul class="navbar"> <li><a href="index.html">home</a></li> <li><a href="#">about us</a> <ul id="ul1"> <li><a id="a1" href="company_profile.html">company profile</a></li> <li><a href="our_philsphoy.html">our philsohpy</a></li> <li><a href="ceo_profile.html">ceo profile</a></li> <li><a href="board_of_direct.html">board of directors</a></li> <li><a href="our_people.html">our people</a></li> <li><a href="global_partners.html">global partnership</a></li> <li><a href="carer.html">career</a></li> </ul> </li> <li><a href="training.html">training</a> <ul id="ul2"> <li><a id="a2" href="academics.html">academics</a></li> <li><a href="coorporate.html">corporate</a></li> <li><a href="personnel.html">our personnel</a></li> </ul> </li> <li><a href="publishing_serv.html">publishing </a></li> <li><a href="http://www.gcbss.org">conferences</a></li> <li><a href="exhibition.html">exhibition</a></li> <li><a href="#">research</a> <ul id="subnavlist"> <li class="b"><a id="subcurrent" href="about_gjbssr.html">about gjbssr</a> <ul class="c"> <li class="a"> <a href="#" >link</a></li> </ul></li> <li><a href="data_collec_services.htm">data collection services</a></li> <li><a href="proof_edit.html">editing &amp; proof reading</a></li> </ul> </li> <li id="active"><a href="contact.html">contact us</a></li> </ul> </div> </body> </html>

css file

.wrapper2 { background: #fff; width: 980px; min-width: 980px; margin: 0 auto; min-height: 800px; } .navbar { height: 50px; padding: 15px; margin: 0; position: absolute; /* ensures menu doesn’t impact other elements */ border-right: 1px solid #54879d; margin-left: 55px; padding-left:15px; padding-bottom:15px; padding-top:0px; margin-left:25px; } .navbar li { height: auto; width: 131px; /* each menu item 150px wide */ float: left; /* lines menu items horizontally */ text-align: center; /* text placed in center of box */ list-style: none; /* removes default styling (bullets) list */ font: normal bold 12px/1.2em arial, verdana, helvetica; padding: 0; margin: 0; background-color: #366b82; } .navbar { padding: 18px 0; /* adds padding on top , bottom text appears centered vertically */ border-left: 1px solid #54879d; /* creates border in lighter shade of bluish background. combined right border, creates nice effect. */ border-right: 1px solid #1f5065; /* creates border in darker shade of bluish background. combined left border, creates nice effect. */ text-decoration: none; /* removes default hyperlink styling. */ color: white; /* text color white */ display: block; } .navbar li:hover, a:hover {background-color: #54879d;} .navbar li ul { display: none; /* hides drop-down menu */ height: auto; margin: 0; /* aligns drop-down box underneath menu item */ padding: 0; /* aligns drop-down box underneath menu item */ } .navbar li:hover ul { display: block; /* displays drop-down box when menu item hovered on */ } .navbar li ul li {background-color: #54879d;} .navbar li ul li { border-left: 1px solid #1f5065; border-right: 1px solid #1f5065; border-top: 1px solid #74a3b7; border-bottom: 1px solid #1f5065; } .navbar li ul li a:hover {background-color: #366b82;} /* add together css code link box*/ .navbar li ul li ul li { display:block; } .b:hover .a{ display:block; margin-left: 130px; margin-top: -50px; } .a{ display: none; }

so why menu image 2 when restore downwards browser ...

any help?

in add-on trevan's answer, container isn't styled. content pushed right bit, if declare width of 12.5% wont on same page.

i've mocked file in jsfiddle.

here new styles:

.navbar { height: 50px; border-right: 1px solid #54879d; width: 100%; margin: 0; padding: 0; } .navbar li { height: auto; width: 12.5%; float: left; text-align: center; list-style: none; font: normal bold 12px/1.2em arial, verdana, helvetica; background-color: #366b82; }

html css html5

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -