javascript - navigation on media cant get 100% width -


my navigation cant full width on media, tried every way , cant locate mistake is, attached code, please if 1 have idea how solve this, , set width full width = 100%? html

<nav class="navi" id="target">     <div class="menu" id="header">          <li><a class="link-1" href="#">home</a></li>         <li><a class="link-1" href="#">second</a></li>         <li><a class="link-1" href="#">third</a></li>         <div class="logo">         <li><a href="#"><img alt="brand" src="logo.png" height="40px" width="60px"></a><li>         </div>      </div> <div class="handle"><p>menu</p></div>     </nav> 

the css:

nav { width:100%; margin-top: 0; padding: 10px; text-align: center; font-family: arial; box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5); position:fixed;  text-align:right; z-index:10;   }  nav li{     display: inline;  } nav ul{ min-height:20px;  } .navi{ background: rgba(0,0, 0, 0.5);   } .navi:hover{ background-color: rgba(0,0,0, 1); }  .link-1 { transition: 0.3s ease; color: #fff; font-size: 16px; text-decoration: none; border-top: 1px solid ; text-align:right; padding: 20px 0px; margin: 0 20px; font-weight: italic; letter-spacing:2px; } .link-1:hover { border-top: 2px solid #fff;  text-decoration: none; color:#fff;  padding: 3px 6px;  }   .logo{ text-align:left; margin-left:35px; margin-top:-25px; }  .menu {display:block;  } .handle {display:none;}  /*media try*/  @media (max-width: 580px) {  #target{  } nav { width:100%; margin-top: 0; display:block; max-height:0; margin-top:-20px; padding-top:18px; padding-right:-20%;  }  nav li{ display:block; padding:10px; background:#000; } .navi{ background: rgba(0,0, 0, 0.9); text-align:center; border:0; background:#000; } .navi:hover{ background-color: rgba(0,0,0, 1); border:0;  }  .link-1 { border:0px solid #bbb; font-size:18px;  } .link-1:hover { text-decoration:underline; border:0px solid #bbb;  }   .logo{ text-align:left; margin-left:35px; margin-top:-25px;     display: none; } .menu {display:none;  } .handle {display:block; color:#fff; font-size:40px; text-decoration:none; text-align:right;  } .handle:hover{  } .handle  p{ color:#fff; cursor: pointer;    -webkit-text-stroke: 1px black;     -webkit-font-smoothing: antialiased;  }   } 

i fixed html.

add box-sizing: border-box; nav.

ul tag missing in html.

also make sure remove default padding , margin ul.

nav ul{ padding: 0; margin:0;}

to stretch menu full width of window, apply bg colour nav, or remove padding:10px nav.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -