I cannot the technical documentation to pass this one test

  1. On regular sized devices (laptops, desktops), the element with id=“navbar” should be shown on the left half of the screen. It should always be visible to the user and should remain stationary. You may need to enlarge the viewport or zoom out to ensure the navbar doesn’t scroll with the page content.
<nav id="navbar">
  <header>
    CSS Documentation
  </header>
  <a href="#Introduction" class="nav-link">Introduction</a>
  <a href="#Learning_Pathway" class="nav-link">Learning Pathway</a>
  <a href="#Use_CSS" class="nav-link">Use CSS</a>
  <a href="#Modules" class="nav-link">Modules</a>
  <a href="#Solving_CSS_Problems" class="nav-link">Solving CSS Problems</a>
  <a href="#See_Also..." class="nav-link">See Also...</a>

</nav>

<main id="main-doc">
  <section class="main-section" id="Introduction">
    <header>Introduction</header>
    <p>Cascading Stylesheets — or CSS — is the first technology you should start learning after HTML. While HTML is used to define the structure and semantics of your content, CSS is used to style it and lay it out. For example, you can use CSS to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.</p>
  </section>

  <section class="main-section" id="Learning_Pathway">
    <header>Learning Pathway</header>
    <p>You should learn the basics of HTML before attempting any CSS. We recommend that you work through our Introduction to HTML module first. In that module, you will learn about:</p>
    <ul>
      <li>CSS, starting with the Introduction to CSS module</li>
      <li>More advanced HTML modules</li>
      <li>JavaScript, and how to use it to add dynamic functionality to web pages</li>
    </ul>
    <p>Once you understand the fundamentals of HTML, we recommend that you learn HTML and CSS at the same time, moving back and forth between the two topics. This is because HTML is far more interesting and much more fun to learn when you apply CSS, and you can't really learn CSS without knowing HTML.

      <p> Before starting this topic, you should also be familiar with using computers and using the web passively (i.e., just looking at it, consuming the content). You should have a basic work environment set up as detailed in Installing basic software and understand how to create and manage files, as detailed in Dealing with files — both of which are parts of our Getting started with the web complete beginner's module.</p>

      <p>It is recommended that you work through Getting started with the web before proceeding with this topic. However, doing so isn't absolutely necessary as much of what is covered in the CSS basics article is also covered in our Introduction to CSS module, albeit in a lot more detail.</p>
  </section>
  <section class="main-section" id="Use_CSS">
    <header>Use CSS</header>
    <p> There are 3 ways to use CSS</p>
    <ul>
      <li>Inline CSS</li>
      <li>Internal CSS</li>
      <li>External CSS</li>
      <h3>Inline CSS</h3>
      <pre>  <code> &lt;button style="color:purple"&gt;Click Me &lt;/button &gt</code>
</pre>
      <pre>  <code> &lt;button &gt;Click Me &lt;/button &gt</code>
</pre>

      <h3> Internal CSS </h3>
      <pre>
      <code>&lt;style&gt;button{color:purple;}&lt;style&gt;</code>
          </pre>

      <h3> External CSS</h3>
      <p>In another CSS file we can have:</p>
      <pre>
      <code>button{color:purple;}</code></pre>
      <p> And then import it into the HTML using the link tag </p>
      <pre> <code>&lt;link rel="stylesheet" href="styles.css"&gt;</code>
        
</pre>

      <section class="main-section" id="Modules">
        <header>Modules</header>
        <p>This topic contains the following modules, in a suggested order for working through them. You should definitely start with the first one.</p>

        <ul>
          <li>CSS first steps
            CSS (Cascading Style Sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. This module provides a gentle beginning to your path towards CSS mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to HTML.</li>
          <li>CSS building blocks
            This module carries on where CSS first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. This module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.

            The aim here is to provide you with a toolkit for writing competent CSS and help you understand all the essential theory, before moving on to more specific disciplines like text styling and CSS layout.</li>

          <li>Styling text
            With the basics of the CSS language covered, the next CSS topic for you to concentrate on is styling text — one of the most common things you'll do with CSS. Here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows and other text features. We round off the module by looking at applying custom fonts to your page, and styling lists and links.</li>
        </ul>
        CSS layout
        <p>At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. Now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about.</p>
      </section>

      <section class="main-section" id="Solving_CSS_Problems">
        <header>Solving CSS Problems</header>
        <p>Use CSS to solve common problems provides links to sections of content explaining how to use CSS to solve very common problems when creating a web page.</p>

        <p>From the beginning, you'll primarily apply colors to HTML elements and their backgrounds; change the size, shape, and position of elements; and add and define borders on elements. But there's not much you can't do once you have a solid understanding of even the basics of CSS. One of the best things about learning CSS is that once you know the fundamentals, usually you have a pretty good feel for what can and can't be done, even if you don't actually know how to do it yet!</p>
      </section>

      <section class="main-section" id="See_Also...">
        <header>See Also...</header>
        <p>Use CSS to solve common problems provides links to sections of content explaining how to use CSS to solve very common problems when creating a web page.

          From the beginning, you'll primarily apply colors to HTML elements and their backgrounds; change the size, shape, and position of elements; and add and define borders on elements. But there's not much you can't do once you have a solid understanding of even the basics of CSS. One of the best things about learning CSS is that once you know the fundamentals, usually you have a pretty good feel for what can and can't be done, even if you don't actually know how to do it yet!</p>
      </section>

</main>

<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>`Preformatted text`
* {
  box-sizing: border-box;
}
@media (max-width:600px;){
  body{
    flex-direction:column;
  }
  
  main{
    height:auto;
    width:100%;
  }
  
  nav{
    border-right:none;
    border-bottom:3px solid white;
    height:200px;
    overflow-y:scroll;
    width:100%;
  } 
  
  
}

body {
display:flex;
  display:wrap;
 
  margin: 0;
}

header{
  font-size:25px;
  padding:15px;
  color:red;
  font-weight:bold:
}
main {
  
  background-color: lightgreen;
  height:100vh;
  overflow-y: scroll;
}
nav {
  background-color: gray;
  border-right:3px solid white;
  max-width: 250px;
  height: 100vh;
  position:flex;
  
}
nav a{
  border-top: 3px solid white;
  color:orange;
  display:block;
  padding:20px;
  text-decoration:none;
}

pre{
  background-color: gray;
  color:blue;
  padding:15px;
  
}
section {
  padding:15px;
  
 
}

Hello there.

Please, for future posts, do not paste a garble of unformatted code. I have partially formatted your code, but this is still not ideal.

In the future, if you have a question about a specific challenge/lesson on the fCC curriculum, use the Get Help button. It will create a pre-populated forum post for you, in the correct subforum.

Also, for help with the certification projects, please paste a link to your CodePen or similar. It would be that much easier to help you, if you linked it.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

When I run the tests, the test that is failing is Layout #2

2. My Technical Documentation page should use at least one media query.

First, you have a syntax error in your media query (there should be no semicolon in there). Second, in order for the media query to have an affect on the page, you need to move it down below the default CSS. When it is up above then it is being cancelled out by the settings below it.

After you make these changes you’ll see that your nav bar is not quite right at narrower browser widths, so you’ll want to fix that.

Also, I’m still getting the same error. I’m not exactly sure what the test is looking for here since I didn’t do this project. So someone else more familiar with it will have to chime in.

On more thing, please add a link to your code.

I always have issues with the media query tests passing on my local machine, but when I upload it to github pages and run the test from there it passes :thinking:

sorry i did not know how to do that but now i do and “Knowing is half the battle!”
bbsmooths recommendation of moving the @media solved my issue

1 Like

Moving the @media query solved my issue. That is the only thing i hadn’t tried. Thank you Very much

BBsmooths recommendation of Moving the @media query solved my issue. That is the only thing i hadn’t tried yet. I really need to start familiarizing myself more with git. I have and account but i haven’t used it yet.