html - How to make dropdown navbar full width -


i have nav bar following html:

<nav id="menu-bar"> <ul>   <li><a href='http://sunilpatro1985.blogspot.in/' >home</a></li>   <li><a href='http://sunilpatro1985.blogspot.in/search/label/seleniumtesting'>selenium</a>     <ul>       <li><a href='http://sunilpatro1985.blogspot.in/2015/04/selenium-testng.html'>testng</a></li>       <li><a href='http://sunilpatro1985.blogspot.com/2015/03/selenium-result-report-testng-ant.html'>ant reporting</a></li>     </ul>   </li>   <li><a href='http://sunilpatro1985.blogspot.in/search/label/softwaretesting'>testingconcepts</a></li>   <li><a href='http://sunilpatro1985.blogspot.in/search/label/basicjava' >javabasics</a></li>   <li><a href='http://sunilpatro1985.blogspot.in/search/label/windowsos' >windows</a></li>   <li><a href='http://sunilpatro1985.blogspot.in/p/demo.html' >demo</a></li> </ul></nav> 

and css used:

#menu-bar {position: fixed; top: 0px; left: 0px; z-index: 999;height:0px;} #menu-bar,#menu-bar {   text-align: center;   margin: 0px 0px; border:none; } #menu-bar ul ul {   display: none; } #menu-bar ul li:hover > ul {   display: block; } #menu-bar ul {   background: #efefef;    background: linear-gradient(top, #efefef 0%, #bbbbbb 100%);     background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%);    background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%);    box-shadow: 0px 0px 9px rgba(0,0,0,0.15);   padding: 0 20px;   border-radius: 7px;     list-style: none;   position: relative;   display: inline-table;   overflow:visible; } #menu-bar ul:after {   content: ""; clear: both; display: block; } #menu-bar ul li {   float: left; } #menu-bar ul li:hover {   background: #4b545f;   background: linear-gradient(top, #4f5964 0%, #5f6975 40%);   background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);   background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%); } #menu-bar ul li:hover {   color: #fff; } #menu-bar ul li {   display: block; padding: 15px 30px;   color: #757575; text-decoration: none; } #menu-bar ul ul {   background: #5f6975; border-radius: 0px; padding: 0;   position: absolute; top: 100%; } #menu-bar ul ul li {   float: none;    border-top: 1px solid #6b727c;   border-bottom: 1px solid #575f6a;   position: relative; } #menu-bar ul ul li {   padding: 15px 30px;   color: #fff; } #menu-bar ul ul li a:hover {   background: #4b545f; } #menu-bar ul ul ul {   position: absolute; left: 100%; top:0; } 

this above menu bar covers 80% of desktop screen. how can make full width? tried options mentioned in other stack overflow answers, nothing helped completely. please me make menu bar full width on screen.

it doesn't you're setting nav element 100% of width in css. try adding this:

#menu-bar { width: 95%;} #menu-bar > ul {width: 100% } 

that worked in jsfiddle may need adjust percentage menu-bar (the first line).


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -