html - Why does my menu not go all the way to the left -


i'm new coding sorry if i'm doing here stupid.

i'm building basic website using html , css. want use 2 navigation bars. 1 on top of screen main navigatio. , 1 on left side navigating through specific page.the first 1 works fine second 1 looks weird. clickable links can't moved further left , therefore sticking out on right. mean:

enter image description here

i'm hovering mouse on "content2"

what doing wrong? here code wrote:

<body>     <nav>         <ul class="navbar">             <li class="navbar"><a class="navbar active" href="index.html">home</a></li>             <li class="navbar"><a class="navbar" href="page1.html">page 1</a></li>             <li class="navbar"><a class="navbar" href="page2.html">page 2</a></li>             <li class="navbar"><a class="navbar" href="page3.html">page 3</a></li>             <li class="navbar"><a class="navbar" href="page4.html">page 4</a></li>         </ul>     </nav>      <div id="contentbar">            <ul class="ucontentbar">             <li class="contentbar"><a class="contentbar" href="#">content1</a></li>             <li class="contentbar"><a class="contentbar" href="#">content2</a></li>             <li class="contentbar"><a class="contentbar" href="#">content3</a></li>             <li class="contentbar"><a class="contentbar" href="#">content4</a></li>             <li class="contentbar"><a class="contentbar" href="#">content5</a></li>             <li class="contentbar"><a class="contentbar" href="#">content6</a></li>             <li class="contentbar"><a class="contentbar" href="#">content7</a></li>         </ul>     </div>      <div id="page">     <p>text</p>      </div>  </body> 

and css goes it:

body { margin: 0px; padding: 0px; }  nav { background-color: rgb(50,50,50); font-family: sans-serif; font-size: 20px; height: 60px; width: 100%;  }  ul.navbar { list-style-type: none; margin: 0px; padding: 0px; overflow: hidden; text-align: right; position: fixed; }  li.navbar{ float: left; height: 60px; }  a.navbar {  display: inline-block; padding: 19px 25px; background-color: rgb(50,50,50); text-align: center; color: white; text-decoration: none; }  a.navbar:hover { background-color: black; }  a.active { background-color: rgb(80,80,220); }  #contentbar { background-color: rgb(100,100,100); font-family: sans-serif; font-size: 14px; width: 300px; height: 100%; display: block; position: absolute; }  ul.contentbar { margin: 0; padding: 0; }  li.contentbar { list-style: none;  }  a.contentbar {  left: 0; background-color: rgb(100,100,100); color: white; display: block; width:300px; height: 30px; text-decoration: none;  }     a.contentbar:hover { background-color: black; }  #page {  background-color: rgb(0,200,100); width: 100%; height: 100%; } 

seems have typo in ul's classname <ul class="ucontentbar"> padding not being applied.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -