Solution 1 :

An ‘a’ element has initial styling that you need to override.

Also, you need to fix your HTML. There’s an errant ‘1’ after id=”home” and you need to add ‘>’ to close your opening div elements.

Try this:

  <head>
    <title>The Accounting Centre</title>
  <link rel="icon" type="image/png" href="TAC.png" sizes="16x16">
    <style>
    body{
      padding: 0;
      margin: 0;
}
    .navbar{
      position: fixed;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: row;
      flex-wrap: wrap;
      background-color:#d4d7de;
      width: 100%;
      height:70px;
      z-index: 1;

    }
      .nav {
        display: flex;
        justify-content: right;
        list-style: none;
        margin:15px;
      
 }
      .nav a {
        color:#000;
        text-decoration: none;
        text-transform: uppercase;
        padding: 0 1rem;
}
        .logo {
          flex: 1 1 auto;
          margin-left: 10%;
          text-transform: uppercase;
          letter-spacing: 1px;
          font-weight: bold;
          font-size:35px;
          margin:15px;
          color:#000;
          text-decoration: none;
          text-transform: uppercase;
}
    </style>
  </head>
 <!DOCTYPE html>
<html>
<body>

      <div class="navbar">
        <a href="#" class="logo">TAC</a>
        <ul class="nav">
          <li><a href="#home">Home</a></li>
          <li><a href="#about">About Us</a></li>
          <li><a href="#services">Our Services</a></li>
          <li><a href="#info">Who We Are</a></li>
          <li><a href="#testimonials">Testimonials</a></li>
          <li><a href="#contact">Contact us</a></li>
        </ul>
      </div>

      <div class="banner-area" id="home"></div>
      <div class="about-area" id="about"></div>
      <div class="services-area" id="services"></div>
      <div class="info-area" id="info"></div>
      <div class="testimonials-area" id="testimonials"></div>
      <div class="contact-area" id="contact"></div>




  </body>

</html>

Solution 2 :

Use bootstraps grid system and assign each of elements inside equal size divs. Then you can use padding in order to have space between elements.

Problem :

So im making a nav bar using html and css only (No JQuery) and i noticed that the css to apply the font style only effects the “TAC” on the left, and not the elements on the right. Furthermore, i need to have each of those words (they are in a list) have a space between them, they are in the same div class.
my code is below the image
enter image description here

<!DOCTYPE html>
<html>
  <head>
    <title>The Accounting Centre</title>
  <link rel="icon" type="image/png" href="TAC.png" sizes="16x16">
    <style>
    body{
      padding: 0;
      margin: 0;
}
    .navbar{
      position: fixed;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: row;
      flex-wrap: wrap;
      background-color:#d4d7de;
      width: 100%;
      height:70px;
      z-index: 1;

    }
      .nav{
        display: flex;
        justify-content: right;
        list-style: none;
        margin:15px;
        color:#000;
        text-decoration: none;
        text-transform: uppercase;


 }
        .logo {
          flex: 1 1 auto;
          margin-left: 10%;
          text-transform: uppercase;
          letter-spacing: 1px;
          font-weight: bold;
          font-size:35px;
          margin:15px;
          color:#000;
          text-decoration: none;
          text-transform: uppercase;




}




    </style>
  </head>
    <body>

      <div class="navbar">
        <a href="#" class="logo">TAC</a>
        <ul class="nav">
          <li><a href="#home">Home</a></li>
          <li><a href="#about">About Us</a></li>
          <li><a href="#services">Our Services</a></li>
          <li><a href="#info">Who We Are</a></li>
          <li><a href="#testimonials">Testimonials</a></li>
          <li><a href="#contact">Contact us</a></li>
        </ul>
      </div>

      <div class="banner-area" id="home"l</div>
      <div class="about-area" id="about"</div>
      <div class="services-area" id="services"</div>
      <div class="info-area" id="info"</div>
      <div class="testimonials-area" id="testimonials"</div>
      <div class="contact-area" id="contact"</div>




  </body>

</html>

Comments

Comment posted by MonteCristo

you have invalid broken html. please fix it. Also you can use code snippet button to create a run-able code within stackover flow its the last button with

Comment posted by ItsMeNaira

whats invalid/broken about it? it runs, also added the run able code thing

By