skip to Main Content

blank spaces on the top margin and on href line. tried fixing with margin=0 and width=100% but nothing changed

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  background-color: rgb(61, 61, 61); 
  font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif
}

<ul> 
        <li><a class="active" href="#">HOME</a><li>
        <li><a href="http://127.0.0.1:5500/ProgettoWeb/portfolio.html" target="_blank" font="arial" >PORTFOLIO</a></li>
        <li><a href="http://127.0.0.1:5500/ProgettoWeb/aboutme.html" target="_blank" >ABOUT ME</a></li>
        <li><a href="http://127.0.0.1:5500/ProgettoWeb/contacts.html" target="_blank" >CONTACTS</a></li>
    </ul>

tried fixing with width and margin but it seems pretty much the same.

3

Answers


  1. You can make a small css reset when you add this lines below:

    * {
      margin: 0;
      padding: 0;
    }
    
    Login or Signup to reply.
  2. I feel like this has something to do with the browser adding margin. Try setting the margin in your body element to 0

    Login or Signup to reply.
  3. The body element naturally comes with some margin.

    body {
      margin: 0;
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search