(error) i dont see the error..please help "You should have the same number of .nav-link and .main-section elements"

<!DOCTYPE html>
<html lang="en"> 
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Technical Document</title>
  <link rel="stylesheet" href="styles.css">
      <nav id="navbar">
          <li><a class="nav-link" href="#Developing_course">Developing course</a></li>
          <li><a class="nav-link" href="#Html_fundamentals">Html fundamentals</a></li>
          <li><a class="nav-link" href="#Css_fundamentals">Css fundamentals</a></li>
          <li><a class="nav-link" href="#Java_fundamentals">Java fundamentals</a></li>
          <li><a class="nav-link" href="#Library">Library</a></li>
      <main id="main-doc">
         <section class="main-section" id="Developing_course">
             <h1>Developing course</h1>
           <a class="nav-link" href="Developing_course">Developing course</a>
           <p>If you’re searching for course creation software, your current forms of learning are probably becoming outdated and unjustifiable. Costs are out of control, productivity has stalled, and inefficient reporting processes waste time.
           <p>So, you know you need change. What you might not know is that you need a learning management system.</p>
         <section class="main-section" id="Html_fundamentals">
           <header><h1>Html fundamentals</h1></header>
           <a class="nav-link" href="Html_fundamentals">Html fundamentals</a>
           <p>Hypertext Markup Language, a standardized system for tagging text files to achieve font, colour, graphic, and hyperlink effects on World Wide Web pages.</p>
           <p>HTML is the standard markup language for creating Web pages. HTML describes the structure of a Web page. HTML consists of a series of elements. HTML elements tell the browser how to display the content. HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc.</p>
             <li>HTML Lists - W3Schools</li>
         <section class="main-section" id="Css_fundamentals">
           <header><h1>Css fundamentals</h1></header>
           <a class="nav-link" href="Css fundamentals">Css fundamentals</a>
           <p>Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG, MathML or XHTML). </p>
           <p>CSS describes how elements should be rendered on screen, on paper, in speech, or on other media</p>
             <li>CSS Styling Lists - W3Schools</li>
         <section class="main-section" id="Java_fundamentals">
           <header><h1>Java fundamentals</h1></header>
           <a class="nav-link" href="Java fundamentals">Java fundamentals</a>
           <p>Java is a platform-independent, object-oriented programming language (OOP). It is not to be confused with JavaScript, a scripting language used to create dynamic web pages.</p>
           <p>Due to its reliability and ease of use, Java is one of the most popular programming languages in the world</p>
             <li>“After all, C++ isn't a perfect match for Java's design aims either.” ~ Bjarne Stroustrup.</li>
         <section class="main-section" id="Library">
           <a class="nav-link" href="Library">Library</a>
           <p>Libraries provide standard functionalities so that developers do not need to worry about creating standard functions from scratch.</p>
           <p> With these libraries, we can create stunning web pages with language utilities, math functions, interactive forms, and more.</p>
             <li>The Quackit HTML Code Library </li>

Welcome there,

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

The more you say, the more we can help.

I’ve edited your code for readability. 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.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

i dont see the error … please help

  • All of your .nav-link elements should be in the #navbar.

  • Failed:You should have the same number of .nav-link and .main-section elements.


@ javierondrums

Si revisas las pruebas que fallan dicen:

  • Todos sus .nav-link elementos deben estar en el archivo #navbar .

Y tu tienes esta linea y otras 4 que se le parecen, las cuales contienen un .nav-link y estan fuera de #navbar

<a class="nav-link" href="Html_fundamentals">Html fundamentals</a>

  • Error: debe tener el mismo número de .nav-link y .main-section elementos.

Si cuentas el numero de .nav-link en tu codigo son 10, mientras el numero de .main-section son 5.

Entonces para que ocupas esta linea y las 4 que se le parecen en tu codigo

<a class="nav-link" href="Html_fundamentals">Html fundamentals</a>

Eliminalas y veras lo que pasa con las pruebas que fallan.


it says "you shoud have the same number of .nav-link and .main-section elements… i guess i already did but it still show me the same “error”

and this: Each .nav-link should have an href attribute that links to its corresponding .main-section (e.g. If you click on a .nav-link element that contains the text “Hello world”, the page navigates to a section element with that id).

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