Technical Documentation Page - Build a Technical Documentation Page

Tell us what’s happening: I am not able to setup media query
Describe your issue in detail here.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html>
  <head>
    <title>Technical Documentation Page</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <nav id="navbar">
      <header>Technical Documentation</header>
      <a class="nav-link" href="#section1">Section1</a>
      <a class="nav-link" href="#section2">Section2</a>
      <a class="nav-link" href="#section3">Section3</a>
      <a class="nav-link" href="#section4">Section4</a>
      <a class="nav-link" href="#section5">Section5</a>
      <!-- Add additional nav-links for each section -->
    </nav>
    <div id="main-doc">
      <section class="main-section" id="section1">
        <header>Section1</header>
        <p>Paragraph 1</p>
        <p>Paragraph 2</p>
        <code>Code example 1</code>
        <code>Code example 2</code>
        <ul>
          <li>List item 1</li>
          <li>List item 2</li>
        </ul>
      </section>
      <section class="main-section" id="section2">
        <header>Section2</header>
        <p>Paragraph 3</p>
        <p>Paragraph 4</p>
        <code>Code example 3</code>
        <code>Code example 4</code>
        <ul>
          <li>List item 3</li>
          <li>List item 4</li>
        </ul>
      </section>
      <section class="main-section" id="section3">
        <header>Section3</header>
        <p>Paragraph 3</p>
        <p>Paragraph 4</p>
        <code>Code example 3</code>
        <code>Code example 4</code>
        <ul>
          <li>List item 3</li>
          <li>List item 4</li>
        </ul>
      </section>
      <section class="main-section" id="section4">
        <header>Section4</header>
        <p>Paragraph 3</p>
        <p>Paragraph 4</p>
        <code>Code example 3</code>
        <code>Code example 4</code>
        <ul>
          <li>List item 3</li>
          <li>List item 4</li>
        </ul>
      </section>
      <section class="main-section" id="section5">
        <header>Section5</header>
        <p>Paragraph 3</p>
        <p>Paragraph 4</p>
        <code>Code example 3</code>
        <code>Code example 4</code>
        <ul>
          <li>List item 3</li>
          <li>List item 4</li>
        </ul>
      </section>
      <!-- Add additional sections as needed -->
    </div>
    <script src="script.js"></script>
  </body>
</html>

/* file: styles.css */
/* Add your CSS styles here */
#main-doc {
  width: 80%;
  margin: 0 auto;
}
.main-section {
  margin: 20px 0;
}
.main-section header {
  font-size: 2em;
  margin: 10px 0;
}
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 20%;
  height: 100%;
  background-color:#333;
  color: #fff;
  padding: 20px;
}
#navbar header {
  font-size: 1.5em;
  margin: 0 0 20px;
}
.nav-link {
  display: block;
  margin: 10px 0;
  font-size: 1em;
  color: #fff;
  text-decoration: none;
}
.nav-link:hover {
  color: #ccc;
}
@media (min-width: 769px) {
  /* Styles to apply when the viewport is larger than 768px */
  #navbar {
    width: 20%;
    height: 100%;
    position: fixed;
  }
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

Hello,
Welcome to the Forums :wave:


The href should be styles.css not style.css.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.