Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
html css navbar to start from left side of screen and background color to fill the whole screen

I want my navbar to start from the left most side of the screen and NOT exceed the right side. and the background color to cover the whole side in the screenshot below, the background color is not covering the screen

enter image description here

HTML code

   <div class="mainWorkDone"> 
                <div class="navbar">
                    <div class="nav2">
                        <h3>Maryam</h3>
                        <a href="#experience">Experience</a>
                        <a href="#education">Education</a>
                        <a href="#workDone">Work </a>
                        <a href="#contact">Contact</a>
                   </div>
                </hr>
                </div>
        </div>

css code

@media screen and (max-height: 450px) {
  .nav2 {
    padding-top: 15px;
    display: flex;
    width: 500px;
    justify-content: start;
  }
  .nav2 a {
    font-size: 15px;
  }
  .nav2 h3 {
    visibility: hidden;
  }
}


.nav2 {
  height: 100%; /* Full-height: remove this if you want "auto" height */
  width: 160px; /* Set the width of the sidebar */
  position: fixed; /* Fixed Sidebar (stay in place on scroll) */
  z-index: 1; /* Stay on top */
  top: 0; /* Stay at the top */
  left: 0;
  overflow-x: hidden; /* Disable horizontal scroll */
  padding-top: 20px;
  color: white;
  border: 2px solid black;
}

/* The navigation menu links */
.nav2 a {
  padding: 6px 8px 6px 16px;
  text-decoration: none;
  font-size: 25px;
  color: #818181;
  display: block;
}

.nav2 h3 {
  color: white;
  font-family: "Inspiration", cursive;
  font-size: 30px;
  color: black;
  justify-content: center;
  display: flex;
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!