Technical Documentation Page - Build a Technical Documentation Page

Tell us what’s happening:

Requirement. No.8 .
I checked and all my id’s in the .main-section match the first child’s text .
What am I missing ? All other requirements meet ,checked for typos and even tried to turn off Caps and match it letter to letter. .

Your code so far

<!-- file: index.html -->

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <main id="main-doc">
      <div class="main-sections">
        <section class="main-section" id="introduction">
          <header class="head-ind">introduction
          </header>
          <p class="main-p">
            C++ is a versatile and high-performance programming language created by Bjarne Stroustrup in the 1980s as an extension of C. Known for its efficiency and object-oriented features, it is widely used in systems programming, game development, and embedded systems. C++ combines low-level control with modern programming paradigms, making it a foundational language for many applications.
            </p>
            <ul>
              <li class="main-list">
                C++ supports both low-level and high-level programming, offering control over hardware while enabling modern programming paradigms.
              </li>
              <li class="main-list">
it is widely used for performance-critical applications like game engines, operating systems, and real-time systems.is widely used for performance-critical applications like game engines, operating systems, and real-time systems.
                </li>
              </ul>
           <header class="head-ind">
             How to learn c++ 
             </header>
            <p class="main-p">
              Learning C++ requires practice and patience. Start by understanding the basics, like syntax, variables, and data types, before moving on to object-oriented concepts such as classes and inheritance. Use online resources, tutorials, or courses, and practice by building small projects like calculators or simple games. Consistent coding and problem-solving will help you master the language over time.
              </p>
<ul>
  <li class="main-list">
    Break down complex topics into smaller sections, starting with the basics, and practice regularly with hands-on coding exercises.
    </li>
    <li class="main-list">
     Join coding communities, participate in challenges, and learn by solving real-world problems or contributing to open-source projects.
      </li>
  </ul>
  <header class="head-ind">
     Your first code
    </header>
    <div id="code-line">
    <code>
     <span id="var"> #include </span> <iostream>
<span id="const">using namespace std;</span>
<br>
int main() {
    cout << "Hello, World!"
    <br></br>
    << endl;
    return 0;
}
      </code>
      </div>
      <header class="head-ind">
        Data types in C++
        </header>
      <p class="main-p">
        A quick overview of a few C++ Data types.
        </p>
      <ul class="main-list">
  <li><code class="data-t">int</code>: Represents integer numbers (e.g., 1, 2, 3).</li>
  <li><code class="data-t">float</code>: Represents decimal numbers with single precision (e.g., 3.14).</li>
  <li><code class="data-t">char</code>: Represents single characters (e.g., 'A', 'B').</li>
  <li><code class="data-t">bool</code>: Represents boolean values (true or false).</li>
</ul>
          </section>
          <section class="main-section"id="basic_syntax">
            <header class="head-ind" >
 basic syntax
</header>
<p class="main-p">
  Understanding the basic syntax of C++ is essential for writing programs. C++ is case-sensitive and uses a structured programming approach. Every program starts with the `main()` function, and statements must end with a semicolon (`;`). 
</p>
<ul>
  <li class="main-list">
    Programs in C++ start with preprocessor directives such as <code>#include</code> to include libraries.
  </li>
  <li class="main-list">
    The <code>main()</code> function is where the program execution begins.
  </li>
</ul>

<header class="head-ind">
  Write Your First C++ Program
</header>
<div id="code-line">
  <code>
    <span id="var">#include</span> &lt;iostream&gt;<br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;string name;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Enter your name: ";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cin >> name;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Hello, " << name << "! Welcome to C++!" << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>
<header class="head-ind">
  Key Features of C++ Syntax
</header>
<ul class="main-list">
  <li><code class="data-t">Semicolons</code>: Every statement ends with a semicolon (`;`).</li>
  <li><code class="data-t">Curly Braces</code>: Use `{}` to define the body of functions and control structures.</li>
  <li><code class="data-t">Comments</code>: Add single-line comments using <code>//</code> and multi-line comments using <code>/* */</code>.</li>
  <li><code class="data-t">Case-Sensitivity</code>: C++ is case-sensitive, so <code>main</code> and <code>Main</code> are different.</li>
</ul>

<header class="head-ind">
  Example of Basic Input and Output
</header>
<p class="main-p">
  In C++, you can use <code>cin</code> to take input and <code>cout</code> to display output. Below is an example:
</p>
<div id="code-line">
  <code>
    <span id="var">#include</span> <iostream><br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;int age;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Enter your age: ";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cin >> age;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "You are " << age << " years old.";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>
</section>
          <section class="main-section"id="language_use">
            <header class="head-ind">language use</header>
<p class="main-p">
  C++ is a powerful and versatile programming language widely used in a variety of fields due to its performance and control over system resources. Its blend of low-level and high-level capabilities makes it suitable for numerous applications, from system-level programming to complex simulations.
</p>
<ul>
  <li class="main-list">
    <code class="data-t">Game Development</code>: C++ is the backbone of many game engines, such as Unreal Engine, because of its high performance and real-time processing capabilities.
  </li>
  <li class="main-list">
    <code class="data-t">Systems Programming</code>: Operating systems, device drivers, and other system-level software are often written in C++ due to its efficiency and hardware-level control.
  </li>
  <li class="main-list">
    <code class="data-t">Embedded Systems</code>: C++ is widely used for programming microcontrollers and embedded devices, as it allows direct hardware interaction.
  </li>
  <li class="main-list">
    <code class="data-t">Scientific Computing</code>: High-performance computing (HPC) applications and simulations in fields such as physics, chemistry, and engineering leverage C++ for its speed.
  </li>
</ul>

<header class="head-ind">
  Key Benefits of Using C++ in These Fields
</header>
<ul class="main-list">
  <li><code class="data-t">Performance</code>: C++ delivers unparalleled speed and efficiency, crucial for resource-intensive applications like games and simulations.</li>
  <li><code class="data-t">Control</code>: Its low-level features allow direct memory management and hardware interaction.</li>
  <li><code class="data-t">Portability</code>: C++ applications can run on a wide range of platforms with minimal modifications.</li>
  <li><code class="data-t">Rich Libraries</code>: C++ provides extensive libraries, such as STL, for tasks like data structures, algorithms, and file handling.</li>
</ul>

<header class="head-ind">
  Example of a Simple C++ Use Case
</header>
<p class="main-p">
  Below is an example of a simple C++ program simulating a basic banking application to demonstrate its use in financial software:
</p>
<div id="code-line">
  <code>
    <span id="var">#include</span> <iostream><br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;double balance, deposit;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;balance = 1000.50;<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Current balance: $" << balance << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Enter amount to deposit: ";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cin >> deposit;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;balance += deposit;<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "New balance: $" << balance << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>
          </section>
          <section class="main-section"id="variables">
            <header class="head-ind">variables</header>
<p class="main-p">
  Variables in C++ are placeholders for storing data that can be manipulated during program execution. Each variable in C++ has a specific type that defines the kind of data it can hold, such as integers, floating-point numbers, characters, or strings.
</p>
<ul>
  <li class="main-list">
    <code class="data-t">Declaration</code>: Variables must be declared with a specific type before use. For example, <code>int age;</code> declares a variable named <code>age</code> of type integer.
  </li>
  <li class="main-list">
    <code class="data-t">Initialization</code>: Variables can be initialized during declaration or later in the program. For example, <code>int age = 25;</code>.
  </li>
  <li class="main-list">
    <code class="data-t">Scope</code>: The scope of a variable determines where it can be accessed in the program. Variables can be local, global, or block-scoped.
  </li>
  <li class="main-list">
    <code class="data-t">Const Variables</code>: Constants are declared using the <code>const</code> keyword and cannot be modified after initialization.
  </li>
</ul>

<header class="head-ind">
  Common Variable Types in C++
</header>
<ul class="main-list">
  <li><code class="data-t">int</code>: Stores integer values (e.g., <code>10</code>, <code>-5</code>).</li>
  <li><code class="data-t">float</code>: Stores decimal values with single precision (e.g., <code>3.14</code>).</li>
  <li><code class="data-t">char</code>: Stores a single character (e.g., <code>'A'</code>, <code>'z'</code>).</li>
  <li><code class="data-t">string</code>: Stores sequences of characters (e.g., <code>"Hello"</code>).</li>
  <li><code class="data-t">bool</code>: Stores Boolean values (<code>true</code> or <code>false</code>).</li>
</ul>

<header class="head-ind">
  Example: Using Variables in C++
</header>
<p class="main-p">
  Below is an example demonstrating variable declaration, initialization, and usage in a program:
</p>
<div id="code-line">
  <code>
    <span id="var">#include</span> <iostream><br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;int age = 25; // Declaring and initializing an integer variable<br>
    &nbsp;&nbsp;&nbsp;&nbsp;float height = 5.9; // Declaring and initializing a floating-point variable<br>
    &nbsp;&nbsp;&nbsp;&nbsp;char grade = 'A'; // Declaring and initializing a character variable<br>
    &nbsp;&nbsp;&nbsp;&nbsp;bool isStudent = true; // Declaring and initializing a Boolean variable<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Age: " << age << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Height: " << height << " feet" << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Grade: " << grade << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Student Status: " << (isStudent ? "Yes" : "No") << endl;<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>

<header class="head-ind">
  Best Practices for Variables
</header>
<ul class="main-list">
  <li>Use meaningful names for variables to improve code readability (e.g., <code>userAge</code> instead of <code>a</code>).</li>
  <li>Initialize variables before using them to avoid unexpected behavior.</li>
  <li>Choose appropriate data types to optimize memory usage and performance.</li>
</ul>
          </section>
          <section class="main-section"id="constants">
  <header class="head-ind">constants</header>
  <p class="main-p">
    Constants in C++ are used to define values that do not change during the program's execution. They are typically used to improve code readability, maintainability, and avoid accidental modifications of critical values.
  </p>
  <ul> 
    <li class="main-list">
      <code class="data-t">const Keyword</code>: Constants are declared using the <code>const</code> keyword. For example: <code>const int maxValue = 100;</code>.
    </li>
    <li class="main-list">
      <code class="data-t">Literal Constants</code>: Values directly written into the code, such as numbers (<code>10</code>), characters (<code>'A'</code>), or strings (<code>"Hello"</code>).
    </li>
    <li class="main-list">
      <code class="data-t">Enumerations</code>: A set of named constants, defined using the <code>enum</code> keyword. For example: <code>enum Color {Red, Green, Blue};</code>.
    </li>
    <li class="main-list">
      <code class="data-t">const with Pointers</code>: Constants can also apply to pointers, either as the value the pointer points to or the pointer itself.
    </li>
  </ul>

  <header class="head-ind">
    Example: Using Constants in C++
  </header>
  <p class="main-p">
    Below is an example demonstrating the usage of constants:
  </p>
  <div id="code-line">
    <code>
      <span id="var">#include</span> &lt;iostream&gt;<br>
      <span id="const">using namespace std;</span><br><br>
      int main() {<br>
      &nbsp;&nbsp;&nbsp;&nbsp;const double pi = 3.14159; // Constant for the value of Pi<br>
      &nbsp;&nbsp;&nbsp;&nbsp;const int maxStudents = 30; // Maximum number of students<br><br>
      &nbsp;&nbsp;&nbsp;&nbsp;cout << "The value of Pi is: " << pi << endl;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;cout << "Maximum students allowed: " << maxStudents << endl;<br><br>
      &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
      }
    </code>
  </div>

  <header class="head-ind">
    Best Practices for Using Constants
  </header>
  <ul>
    <li class="main-list">Use meaningful names for constants to improve code readability (e.g., <code>pi</code>, <code>maxStudents</code>).</li>
    <li class="main-list">Prefer constants over hardcoded values to make the code easier to maintain.</li>
    <li class="main-list">Use <code>constexpr</code> for compile-time constants when appropriate.</li>
  </ul>
</section>
        </div>
      <div class="nav-bar">
        <nav id="navbar">
        <header id="nav-h">
       C++ Documentation
        </header>
        <section class="header-box" id="intro-a">
          <a class="nav-link" href="#introduction">Introduction</a>
          </section>
      <section class="header-box" id="basic-a">
          <a class="nav-link" href="#basic_syntax">Basic syntax</a>
          </section>
        <section class="header-box" id="language-a">
          <a class="nav-link" href="#language_use">Language Use</a>
          </section>
        <section class="header-box" id="variables-a">
          <a class="nav-link" href="#variables">Variables</a>
          </section>
        <section class="header-box" id="constants-a">
          <a class="nav-link" href="#constants">Constants</a>
          </section>
     </nav>
      </div>
    </main>
  </body>
  <script>
    
    </script>
  </html>

/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (iPad; CPU OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.154 Mobile/15E148 Safari/604.1

Challenge Information:

Technical Documentation Page - Build a Technical Documentation Page

Hi there!

Section elements around anchor elements within the nav elements prevents the test from passing the challenge.

changed the sections to div elements ,still doesn’t work. I use them for styling purposes

You need a space between the pair of attribute and it’s value.

Anchor text and href value should be exactly the same, even upper/lower case for all anchor elements.


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <main id="main-doc">
      <div class="main-sections">
        <section class="main-section" id="Introduction">
          <header class="head-ind">Introduction
          </header>
          <p class="main-p">
            C++ is a versatile and high-performance programming language created by Bjarne Stroustrup in the 1980s as an extension of C. Known for its efficiency and object-oriented features, it is widely used in systems programming, game development, and embedded systems. C++ combines low-level control with modern programming paradigms, making it a foundational language for many applications.
            </p>
            <ul>
              <li class="main-list">
                C++ supports both low-level and high-level programming, offering control over hardware while enabling modern programming paradigms.
              </li>
              <li class="main-list">
it is widely used for performance-critical applications like game engines, operating systems, and real-time systems.is widely used for performance-critical applications like game engines, operating systems, and real-time systems.
                </li>
              </ul>
           <header class="head-ind">
             How to learn c++ 
             </header>
            <p class="main-p">
              Learning C++ requires practice and patience. Start by understanding the basics, like syntax, variables, and data types, before moving on to object-oriented concepts such as classes and inheritance. Use online resources, tutorials, or courses, and practice by building small projects like calculators or simple games. Consistent coding and problem-solving will help you master the language over time.
              </p>
<ul>
  <li class="main-list">
    Break down complex topics into smaller sections, starting with the basics, and practice regularly with hands-on coding exercises.
    </li>
    <li class="main-list">
     Join coding communities, participate in challenges, and learn by solving real-world problems or contributing to open-source projects.
      </li>
  </ul>
  <header class="head-ind">
     Your first code
    </header>
    <div id="code-line">
    <code>
     <span id="var"> #include </span> <iostream>
<span id="const">using namespace std;</span>
<br>
int main() {
    cout << "Hello, World!"
    <br></br>
    << endl;
    return 0;
}
      </code>
      </div>
      <header class="head-ind">
        Data types in C++
        </header>
      <p class="main-p">
        A quick overview of a few C++ Data types.
        </p>
      <ul class="main-list">
  <li><code class="data-t">int</code>: Represents integer numbers (e.g., 1, 2, 3).</li>
  <li><code class="data-t">float</code>: Represents decimal numbers with single precision (e.g., 3.14).</li>
  <li><code class="data-t">char</code>: Represents single characters (e.g., 'A', 'B').</li>
  <li><code class="data-t">bool</code>: Represents boolean values (true or false).</li>
</ul>
          </section>
          <section class="main-section" id="Basic_syntax">
            <header class="head-ind" >
 Basic syntax
</header>
<p class="main-p">
  Understanding the basic syntax of C++ is essential for writing programs. C++ is case-sensitive and uses a structured programming approach. Every program starts with the `main()` function, and statements must end with a semicolon (`;`). 
</p>
<ul>
  <li class="main-list">
    Programs in C++ start with preprocessor directives such as <code>#include</code> to include libraries.
  </li>
  <li class="main-list">
    The <code>main()</code> function is where the program execution begins.
  </li>
</ul>

<header class="head-ind">
  Write Your First C++ Program
</header>
<div id="code-line">
  <code>
    <span id="var">#include</span> &lt;iostream&gt;<br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;string name;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Enter your name: ";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cin >> name;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Hello, " << name << "! Welcome to C++!" << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>
<header class="head-ind">
  Key Features of C++ Syntax
</header>
<ul class="main-list">
  <li><code class="data-t">Semicolons</code>: Every statement ends with a semicolon (`;`).</li>
  <li><code class="data-t">Curly Braces</code>: Use `{}` to define the body of functions and control structures.</li>
  <li><code class="data-t">Comments</code>: Add single-line comments using <code>//</code> and multi-line comments using <code>/* */</code>.</li>
  <li><code class="data-t">Case-Sensitivity</code>: C++ is case-sensitive, so <code>main</code> and <code>Main</code> are different.</li>
</ul>

<header class="head-ind">
  Example of Basic Input and Output
</header>
<p class="main-p">
  In C++, you can use <code>cin</code> to take input and <code>cout</code> to display output. Below is an example:
</p>
<div id="code-line">
  <code>
    <span id="var">#include</span> <iostream><br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;int age;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Enter your age: ";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cin >> age;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "You are " << age << " years old.";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>
</section>
          <section class="main-section" id="Language_Use">
            <header class="head-ind">Language Use</header>
<p class="main-p">
  C++ is a powerful and versatile programming language widely used in a variety of fields due to its performance and control over system resources. Its blend of low-level and high-level capabilities makes it suitable for numerous applications, from system-level programming to complex simulations.
</p>
<ul>
  <li class="main-list">
    <code class="data-t">Game Development</code>: C++ is the backbone of many game engines, such as Unreal Engine, because of its high performance and real-time processing capabilities.
  </li>
  <li class="main-list">
    <code class="data-t">Systems Programming</code>: Operating systems, device drivers, and other system-level software are often written in C++ due to its efficiency and hardware-level control.
  </li>
  <li class="main-list">
    <code class="data-t">Embedded Systems</code>: C++ is widely used for programming microcontrollers and embedded devices, as it allows direct hardware interaction.
  </li>
  <li class="main-list">
    <code class="data-t">Scientific Computing</code>: High-performance computing (HPC) applications and simulations in fields such as physics, chemistry, and engineering leverage C++ for its speed.
  </li>
</ul>

<header class="head-ind">
  Key Benefits of Using C++ in These Fields
</header>
<ul class="main-list">
  <li><code class="data-t">Performance</code>: C++ delivers unparalleled speed and efficiency, crucial for resource-intensive applications like games and simulations.</li>
  <li><code class="data-t">Control</code>: Its low-level features allow direct memory management and hardware interaction.</li>
  <li><code class="data-t">Portability</code>: C++ applications can run on a wide range of platforms with minimal modifications.</li>
  <li><code class="data-t">Rich Libraries</code>: C++ provides extensive libraries, such as STL, for tasks like data structures, algorithms, and file handling.</li>
</ul>

<header class="head-ind">
  Example of a Simple C++ Use Case
</header>
<p class="main-p">
  Below is an example of a simple C++ program simulating a basic banking application to demonstrate its use in financial software:
</p>
<div id="code-line">
  <code>
    <span id="var">#include</span> <iostream><br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;double balance, deposit;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;balance = 1000.50;<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Current balance: $" << balance << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Enter amount to deposit: ";<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cin >> deposit;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;balance += deposit;<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "New balance: $" << balance << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>
          </section>
          <section class="main-section" id="Variables">
            <header class="head-ind">Variables</header>
<p class="main-p">
  Variables in C++ are placeholders for storing data that can be manipulated during program execution. Each variable in C++ has a specific type that defines the kind of data it can hold, such as integers, floating-point numbers, characters, or strings.
</p>
<ul>
  <li class="main-list">
    <code class="data-t">Declaration</code>: Variables must be declared with a specific type before use. For example, <code>int age;</code> declares a variable named <code>age</code> of type integer.
  </li>
  <li class="main-list">
    <code class="data-t">Initialization</code>: Variables can be initialized during declaration or later in the program. For example, <code>int age = 25;</code>.
  </li>
  <li class="main-list">
    <code class="data-t">Scope</code>: The scope of a variable determines where it can be accessed in the program. Variables can be local, global, or block-scoped.
  </li>
  <li class="main-list">
    <code class="data-t">Const Variables</code>: Constants are declared using the <code>const</code> keyword and cannot be modified after initialization.
  </li>
</ul>

<header class="head-ind">
  Common Variable Types in C++
</header>
<ul class="main-list">
  <li><code class="data-t">int</code>: Stores integer values (e.g., <code>10</code>, <code>-5</code>).</li>
  <li><code class="data-t">float</code>: Stores decimal values with single precision (e.g., <code>3.14</code>).</li>
  <li><code class="data-t">char</code>: Stores a single character (e.g., <code>'A'</code>, <code>'z'</code>).</li>
  <li><code class="data-t">string</code>: Stores sequences of characters (e.g., <code>"Hello"</code>).</li>
  <li><code class="data-t">bool</code>: Stores Boolean values (<code>true</code> or <code>false</code>).</li>
</ul>

<header class="head-ind">
  Example: Using Variables in C++
</header>
<p class="main-p">
  Below is an example demonstrating variable declaration, initialization, and usage in a program:
</p>
<div id="code-line">
  <code>
    <span id="var">#include</span> <iostream><br>
    <span id="const">using namespace std;</span><br><br>
    int main() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;int age = 25; // Declaring and initializing an integer variable<br>
    &nbsp;&nbsp;&nbsp;&nbsp;float height = 5.9; // Declaring and initializing a floating-point variable<br>
    &nbsp;&nbsp;&nbsp;&nbsp;char grade = 'A'; // Declaring and initializing a character variable<br>
    &nbsp;&nbsp;&nbsp;&nbsp;bool isStudent = true; // Declaring and initializing a Boolean variable<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Age: " << age << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Height: " << height << " feet" << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Grade: " << grade << endl;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;cout << "Student Status: " << (isStudent ? "Yes" : "No") << endl;<br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
    }
  </code>
</div>

<header class="head-ind">
  Best Practices for Variables
</header>
<ul class="main-list">
  <li>Use meaningful names for variables to improve code readability (e.g., <code>userAge</code> instead of <code>a</code>).</li>
  <li>Initialize variables before using them to avoid unexpected behavior.</li>
  <li>Choose appropriate data types to optimize memory usage and performance.</li>
</ul>
          </section>
          <section class="main-section" id="Constants">
  <header class="head-ind">Constants</header>
  <p class="main-p">
    Constants in C++ are used to define values that do not change during the program's execution. They are typically used to improve code readability, maintainability, and avoid accidental modifications of critical values.
  </p>
  <ul> 
    <li class="main-list">
      <code class="data-t">const Keyword</code>: Constants are declared using the <code>const</code> keyword. For example: <code>const int maxValue = 100;</code>.
    </li>
    <li class="main-list">
      <code class="data-t">Literal Constants</code>: Values directly written into the code, such as numbers (<code>10</code>), characters (<code>'A'</code>), or strings (<code>"Hello"</code>).
    </li>
    <li class="main-list">
      <code class="data-t">Enumerations</code>: A set of named constants, defined using the <code>enum</code> keyword. For example: <code>enum Color {Red, Green, Blue};</code>.
    </li>
    <li class="main-list">
      <code class="data-t">const with Pointers</code>: Constants can also apply to pointers, either as the value the pointer points to or the pointer itself.
    </li>
  </ul>

  <header class="head-ind">
    Example: Using Constants in C++
  </header>
  <p class="main-p">
    Below is an example demonstrating the usage of constants:
  </p>
  <div id="code-line">
    <code>
      <span id="var">#include</span> &lt;iostream&gt;<br>
      <span id="const">using namespace std;</span><br><br>
      int main() {<br>
      &nbsp;&nbsp;&nbsp;&nbsp;const double pi = 3.14159; // Constant for the value of Pi<br>
      &nbsp;&nbsp;&nbsp;&nbsp;const int maxStudents = 30; // Maximum number of students<br><br>
      &nbsp;&nbsp;&nbsp;&nbsp;cout << "The value of Pi is: " << pi << endl;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;cout << "Maximum students allowed: " << maxStudents << endl;<br><br>
      &nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
      }
    </code>
  </div>

  <header class="head-ind">
    Best Practices for Using Constants
  </header>
  <ul>
    <li class="main-list">Use meaningful names for constants to improve code readability (e.g., <code>pi</code>, <code>maxStudents</code>).</li>
    <li class="main-list">Prefer constants over hardcoded values to make the code easier to maintain.</li>
    <li class="main-list">Use <code>constexpr</code> for compile-time constants when appropriate.</li>
  </ul>
</section>
        </div>
      <div class="nav-bar">
        <nav id="navbar">
        <header id="nav-h">
       C++ Documentation
        </header>
        <div class="header-box" id="intro-a">
          <a class="nav-link" href="#Introduction">Introduction</a>
          </div>
      <div class="header-box" id="basic-a">
          <a class="nav-link" href="#Basic_syntax">Basic syntax</a>
          </div>
        <div class="header-box" id="language-a">
          <a class="nav-link" href="#Language_Use">Language Use</a>
          </div>
        <div class="header-box" id="variables-a">
          <a class="nav-link" href="#Variables">Variables</a>
          </div>
        <div class="header-box" id="constants-a">
          <a class="nav-link" href="#Constants">Constants</a>
          </div>
     </nav>
      </div>
    </main>
  </body>
  </html>

Still doesn’t work

Hello @toshiba1850!

Keep up the good work.

When I pasted your code into the step, the only thing it is asking for is:

22. Your Technical Documentation project should use at least one media query.

This needs to be completed in your CSS files.

Remember a media query appears like:

@media (max-width: 400px){
element {
property: value;
}
}

Wishing you good progress on your coding journey. :slightly_smiling_face:

*,
*::before,
*::after {
  box-sizing: border-box;
}
html , body {
 margin:0;
 padding:0;
 height:100%;
 width:100%;
}
#main-doc {
  position:relative;
  font-family:helvetica,sans-serif;
  font-weight:100;
  white-space:normal;
  }
.main-sections{
  background-color:#f2f2f0;
  width:70vw;
  max-width:70%;
  position:absolute;
  left:30vw;
}
#Introduction {
  display:block;
}
.main-section{
  display:none;
}
.main-section:target{
  display:block;
}
.head-ind {
  font-size:1.6rem;
  font-weight:400;
  padding:10px 0 5px 35px;
}
#code-line { 
  width:50vw;
  background-color:#ede4e4;
  margin:20px 0;
  padding:5px 20px 0px 150px;
  margin-left:130px;
  border-radius:2%;
}

.main-p {
  padding:5px 35px 5px 60px;
  margin:5px 5px 0px 0px;
  font-weight:400;
}
.main-list {
  margin:5px 30px 0px 95px;
}
.nav-bar {
  position:fixed;
  top:0;
  bottom:0;
  margin:0;
  gap:5vh;
  min-width:30vw;
  max-width:100vw;
  min-height:90vh;
  max-height:100vh;
  border-right:3px solid;
  background-color:#f2f2f0;
  padding-left:10px;
  }
#nav-h { 
  position:fixed;
  top:2vh;
  left:1.2vw;
  font-size:1.6rem;
  font-weight:400;
  padding:15px 10px;
}
.header-box {
  position:relative;
  top:13vh;
  display:flex;
  flex-direction:column;
  align-content:space-evenly;
  margin-top:0px;
  margin-bottom:0px;
  font-size:1.2rem;
  border-top:1px solid;
  padding:20px 5px 0;
}
.nav-bar a{
 display:block;
 height:3.7vh;
 box-sizing:border-box;
}
#var:hover {
  color:red;
}
#const:hover {
  color:green;
}
.data-t {
  color:#6197ed;
  text-decoration:underline;
}
a {
  text-decoration:none;
  color:black;
}
#intro-a {
  position:relative;
  z-index:1;
}
#intro-a:hover {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
#intro-a::after{
 content:'';
  position:absolute;
  top:0.08vh;
  left:0vw;
  height:43px;
  width:28.7vw;
  background-color:#c1c3c9;
  opacity:0;
  transition:opacity 600ms ease-in-out;
  z-index:-1;
}
#intro-a:hover::after{
  opacity:1;
}

#basic-a {
  position:relative;
  z-index:1;
}

#basic-a:hover {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
#basic-a::after{
  content:'';
  position:absolute;
  top:0.08vh;
  left:0vw;
  height:43px;
  width:28.7vw;
  background-color:#c1c3c9;
  opacity:0;
  transition:opacity 800ms ease-in-out;
  z-index:-1;
}
#basic-a:hover::after{
  opacity:1;
}
#language-a {
  z-index:1;
  position:relative;
}
#language-a:hover{
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
#language-a::after{
  content:'';
  position:absolute;
  top:0.08vh;
  left:0vw;
  height:43px;
  width:28.7vw;
  background-color:#c1c3c9;
  opacity:0;
  transition:opacity 800ms ease-in-out;
  z-index:-1;
}
#language-a:hover::after {
  opacity:1;
}
#variables-a {
  z-index:1;
  position:relative;
}
#variables-a:hover{
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
#variables-a::after{
  content:'';
  position:absolute;
  top:0.08vh;
  left:0vw;
  height:43px;
  width:28.7vw;
  background-color:#c1c3c9;
  opacity:0;
  transition:opacity 800ms ease-in-out;
  z-index:-1;
}
#variables-a:hover::after {
  opacity:1;
}
#constants-a {
  z-index:1;
  position:relative;
}
#constants-a:hover{
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
#constants-a::after{
  content:'';
  position:absolute;
  top:0.08vh;
  left:0vw;
  height:43px;
  width:28.7vw;
  background-color:#c1c3c9;
  opacity:0;
  transition:opacity 800ms ease-in-out;
  z-index:-1;
}
#constants-a:hover::after {
  opacity:1;
}
@media (max-width:768px){
  html , body {
    overflow-x:hidden;
  }

  .head-ind {
    font-size:1.1rem;
  }

  .nav-bar {
    width:40%;
    height:100%;
    position:fixed;
  }

.main-sections {
   position:relative;
   width:100%;
   left:130px;
   font-size:0.9rem;
}

#code-line {
  position:relative;
  right:80px;
}
  #code-line code {
    position:relative;
    right:40px;
  }
#nav-h {
  font-size:0.8rem;
}
#intro-a::after {
  width:37vw;
}
#basic-a::after {
  width:37vw;
}
#language-a::after {
  width:37vw;
}
#variables-a::after {
  width:37vw;
}
#constants-a::after {
  width:37vw;
}
}

i’m using a media query this is the css i didnt include it here …
still can’t solve this problem of no.8

After @media you didn’t specified the type of that media rule. Like print or only screen etc.

fixed @ media .
still not working :))

Use that link to validate your html/css files:

https://jigsaw.w3.org/css-validator/