I can’t find the mistake:
Each .main-section
should have an id
that matches the text of its first child, having any spaces in the child’s text replaced with underscores (_
) for the id’s.
AND
Each .nav-link
should have text that corresponds to the header
text of its related section
(e.g. if you have a “Hello world” section/header, your #navbar
should have a .nav-link
which has the text “Hello world”).
Here’s my HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="HTML Documentation" />
<title>C Documentation Page</title>
<link rel="stylesheet" href="styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@600&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.4.0/css/all.css">
</head>
<body>
<nav id="navbar">
<header><h1>C Documentation</h1><i class="fa-solid fa-book logo"></i></i></header>
<ul>
<hr>
<li><a class="nav-link" href="#Introduction">Introduction</a></li>
<hr>
<li><a class="nav-link" href="#Features">Features</a></li>
<hr>
<li><a class="nav-link" href="#Syntax">Syntax</a></li>
<hr>
<li><a class="nav-link" href="#Data_Types">Data Types</a></li>
<hr>
<li><a class="nav-link" href="#Control_Flow">Control Flow</a></li>
<hr>
<li><a class="nav-link" href="#Functions">Functions</a></li>
<hr>
<li><a class="nav-link" href="#Pointers">Pointers</a></li>
<hr>
<li><a class="nav-link" href="#Memory_Management">Memory Management</a></li>
<hr>
<li><a class="nav-link" href="#Standard_Library">Standard Library</a></li>
<hr>
<li><a class="nav-link" href="#Conclusion">Conclusion</a></li>
<hr>
<li><a class="nav-link" href="#Reference">Reference</a></li>
<hr>
</ul>
<i class="fa-solid fa-code sign"></i>
</nav>
<main id="main-doc">
<section class="main-section" id="Introduction">
<header><h2>Introduction</h2></header>
<p class="description">C is a general-purpose, procedural programming language developed in the early 1970s by Dennis Ritchie at Bell Labs. It is one of the most widely used programming languages and has significantly influenced many other programming languages.</p>
</section>
<section class="main-section" id="Features">
<header><h2>Features</h2></header>
<ul class="description">
<li><strong>Portability</strong>: C is designed to be highly portable and can run on various platforms with minimal modifications.</li>
<li><strong>Efficiency</strong>: C allows for low-level memory manipulation and direct hardware access, making it highly efficient for system-level programming.</li>
<li><strong>Modularity</strong>: C supports functions and user-defined data types, enabling the creation of modular and reusable code.</li>
<li><strong>Wide Usage</strong>: C is used in operating systems, embedded systems, games, compilers, and other performance-critical applications.</li>
<li><strong>File Handling</strong>: C provides built-in functions for file handling, allowing developers to read and write data to files on the computer's disk. File handling is crucial for tasks such as data storage, configuration files, and persistent data.</li>
</ul>
</section>
<section class="main-section" id="Syntax">
<header><h2>Syntax</h2></header>
<p class="description">C syntax is derived from the B programming language and follows a relatively simple and concise structure. A C program consists of functions, where the <code>main()</code> function is the entry point of execution. <span class="example">Example:</span></p>
<div class="code-snippet"><pre>
#include <,stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}</pre></div>
</section>
<section class="main-section" id="Data_Types">
<header><h2>Data Types</h2></header>
<p class="description">C has several basic data types, including <code>int</code>, <code>float</code>, <code>char</code>, <code>double</code>, etc. It also allows users to create custom data types using <code>struct</code> and <code>typedef</code>.</p>
</section>
<section class="main-section" id="Control_Flow">
<header><h2>Control Flow</h2></header>
<p class="description">C supports various control flow statements such as <code>if</code>, <code>else</code>, <code>for</code>, <code>while</code>, and <code>switch</code> to control the flow of program execution. <span class="example">Example:</span></p>
<div class="code-snippet"><pre>
int x = 10;
if (x > 5) {
printf("x is greater than 5.\n");
} else {
printf("x is less than or equal to 5.\n");
}</pre></div>
</section>
<section class="main-section" id="Functions">
<header><h2>Functions</h2></header>
<p class="description">C allows users to define and use functions, which help break down complex tasks into smaller, manageable parts. Functions can have input parameters and return values. <span class="example">Example:</span></p>
<div class="code-snippet"><pre>
int add(int a, int b) {
return a + b;
}</pre></div>
</section>
<section class="main-section" id="Pointers">
<header><h2>Pointers</h2></header>
<p class="description">Pointers are a powerful feature in C, allowing direct manipulation of memory addresses. They are commonly used for dynamic memory allocation and passing addresses to functions. <span class="example">Example:</span></p>
<div class="code-snippet"><pre>
int x = 10;
int *ptr = &x;</pre></div>
</section>
<section class="main-section" id="Memory_Management">
<header><h2>Memory Management</h2></header>
<p class="description">C provides manual memory management through functions like <code>malloc()</code>, <code>calloc()</code>, and <code>free()</code>, allowing developers to control memory allocation and deallocation.</p>
</section>
<section class="main-section" id="Standard_Library">
<header><h2>Standard Library</h2></header>
<p class="description">C comes with a standard library that provides various built-in functions for tasks like I/O, string manipulation, mathematical operations, and more. It can be included using <code>#include directive</code>. <span class="example">Example:</span></p>
<div class="code-snippet"><pre>
#include <,stdio.h>
int main() {
char name[20];
printf("Enter your name: ");
scanf("%s", name);
printf("Hello, %s!\n", name);
return 0;
}</pre></div>
</section>
<section class="main-section" id="Conclusion">
<header><h2>Conclusion</h2></header>
<p class="description">C remains a fundamental language for programming due to its efficiency, versatility, and wide usage in various domains. It is an excellent language for beginners to learn the basics of programming and build a strong foundation for other languages. However, as with any language, proper understanding and coding practices are essential to ensure efficient and secure software development.</p>
</section>
<section class="main-section" id="Reference">
<header><h2>Reference</h2></header>
<p><em class="description">All the documentation in this page is taken from <a href="https://chat.openai.com/share/ff416f8c-09fc-44f5-9251-47ce85f1f068">ChatGPT</a></em></p>
</section>
</main>
</body>
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/17.0 Safari/605.1.15
Challenge: Technical Documentation Page - Build a Technical Documentation Page
Link to the challenge: