Good Afternoon,
I would like to inform you that I followed the latest correct HTML and CSS Code in Build a Technical Documentation Page Certification in Responsive Web Design Certification in FreeCodeCamp, FYI.
Here’s what the instruction says:
Objective: Build an app that is functionally similar to https://technical-documentation-page.freecodecamp.rocks. Do not copy this demo project.
User Stories:
- You can see a main element with a corresponding id=“main-doc”, which contains the page’s main content (technical documentation)
- Within the #main-doc element, you can see several section elements, each with a class of main-section. There should be a minimum of five
- The first element within each .main-section should be a header element, which contains text that describes the topic of that section.
- Each section element with the class of main-section should also have an id that corresponds with the text of each header contained within it. Any spaces should be replaced with underscores (e.g. The section that contains the header “JavaScript and Java” should have a corresponding id=“JavaScript_and_Java”)
- The .main-section elements should contain at least ten p elements total (not each)
- The .main-section elements should contain at least five code elements total (not each)
- The .main-section elements should contain at least five li items total (not each)
- You can see a nav element with a corresponding id=“navbar”
- The navbar element should contain one header element which contains text that describes the topic of the technical documentation
- Additionally, the navbar should contain link (a) elements with the class of nav-link. There should be one for every element with the class main-section
- The header element in the #navbar must come before any link (a) elements in the navbar
- Each element with the class of nav-link should contain text that corresponds to the header text within each section (e.g. if you have a “Hello world” section/header, your navbar should have an element which contains the text “Hello world”)
- When you click on a navbar element, the page should navigate to the corresponding section of the #main-doc element (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, and contains the corresponding header)
- On regular sized devices (laptops, desktops), the element with id=“navbar” should be shown on the left side of the screen and should always be visible to the user
- Your technical documentation should use at least one media query
Fulfill the user stories and pass all the tests below to complete this project. Give it your own personal style. Happy Coding!
Note: Be sure to add in your HTML to link your stylesheet and apply your CSS
The tests are the following:
- You should have a main element with an id of main-doc.
- You should have at least five section elements with a class of main-section.
- All of your .main-section elements should be section elements.
- You should have at least five .main-section elements that are descendants of #main-doc.
- The first child of each .main-section should be a header element.
- None of your header elements should be empty.
- All of your .main-section elements should have an id.
- 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.
- You should have at least 10 p elements (total) within your .main-section elements.
- You should have at least five code elements that are descendants of .main-section elements.
- You should have at least five li elements that are descendants of .main-section elements.
- You should have a nav element with an id of navbar.
- Your #navbar should have exactly one header element within it.
- You should have at least one a element with a class of nav-link.
- All of your .nav-link elements should be anchor (a) elements.
- All of your .nav-link elements should be in the #navbar.
- You should have the same number of .nav-link and .main-section elements.
- The header element in the #navbar should come before any link (a) elements also in the #navbar.
- 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”).
- 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).
- Your #navbar should always be on the left edge of the window.
- Your Technical Documentation project should use at least one media query.
Here’s my revised HTML and CSS Code:
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
<title>Technical Documentation</title>
</head>
<body>
<nav id="navbar">
<header>Multiplication in Mathematics</header>
<a class="nav-link" href="#What_is_Logic">What is Logic?</a>
<a class="nav-link" href="#Commutative_Property_of_Multiplication">Commutative Property of Multiplication</a>
<a class="nav-link" href="#Multiplying_Factors_without_Symbols">Multiplying Factors without Symbols</a>
<a class="nav-link" href="#Prime_Factorization">Prime Factorization</a>
<a class="nav-link" href="#Identity_Property_of_Multiplication">Identity Property of Multiplication</a>
<a class="nav-link" href="#Rules_of_1">Rules of 1</a>
<a class="nav-link" href="#Product_Rule">Product Rule</a>
<a class="nav-link" href="#Distributive_Property">Distributive Property</a>
</nav>
<main id="main-doc">
<section class="main-section" id="What_is_Logic">
<header>What is Logic?</header>
<p><ins>Logic</ins> - is the science and art of correct thinking and correct reasoning.</p>
</section>
<section class="main-section" id="Commutative_Property_of_Multiplication">
<header>Commutative Property of Multiplication</header>
<p>Changing the order of the multiplicand and the multiplier does not change the product.<br /><br />Examples focusing on Formula:</p>
<ol>
<li>To Compute for the Percentage (P):</li>
<code>R × B = B × R</code>
<li>To Convert from Degree Fahrenheit (°F) to Degree Celsius (°C):</li>
<code>5/9 × (°F − 32) = (°F − 32) × 5/9</code>
</ol>
</section>
<section class="main-section" id="Multiplying_Factors_without_Symbols">
<header>Multiplying Factors without Symbols</header>
<p>Examples:</p>
<ol>
<li>Translating Words into Algebraic Expressions:</li>
<p class="multiply">Word: x times 3</p>
<code>3x</code>
<p class="x">Algebraic Expression: <del>x × 3</del></p>
<p class="ratio">- because a times sign (×) looks like a variable x.</p>
<li>Circumference of the Circle:</li>
<code>C = 2𝜋r</code>
<p class="explain">- this formula means <mark>2 × 𝜋 × r</mark> because like what is just explained in number 1 above within the topic Multiplying Factors without Symbols.</p>
</ol>
</section>
<section class="main-section" id="Prime_Factorization">
<header>Prime Factorization</header>
<p>Prime Factorization is a way of finding the prime factors of a number, such that the original number is evenly divisible by these factors.<br /><br />Example focusing on Factoring the Circumference of the Circle:</p>
<code>= 𝜋d</code>
<code>= 2𝜋r</code>
<p class="explain">- it is because the formula for diameter is:</p>
<code>d = 2r</code>
</section>
<section class="main-section" id="Identity_Property_of_Multiplication">
<header>Identity Property of Multiplication</header>
<p>Any number multiplied by 1 equals itself.<br /><br />Example/s focusing on Algebra:</p>
<ol>
<li><code>1x = x</code></li>
<li><code>x + x = (1 + 1)x = 2x</code></li>
<p class="explain">- if they have like terms, any monomial added by another monomial automatically adds their numbers.</p>
</ol>
</section>
<section class="main-section" id="Rules_of_1">
<header>Rules of 1</header>
<p>Any number raised to 1 equals itself.<br /><br />Example focusing on Radius:</p>
<code>r¹ = r</code>
</section>
<section class="main-section" id="Product_Rule">
<header>Product Rule</header>
<p>To find the product of two numbers with the same base, add the exponents.<br /><br />Example focusing on Area of the Circle:</p>
<code>A = 𝜋r ⋅ r</code>
<code>A = 𝜋r¹ ⁺ ¹</code>
<code>A = 𝜋r²</code>
</section>
<section class="main-section" id="Distributive_Property">
<header>Distributive Property</header>
<p>When a number is multiplied with the sum of the addends, it will give the same result if we multiply each addend separately by the number given outside the brackets.<br /><br />Examples focusing on Multiplication of Polynomials:</p>
<ol>
<li>3x(4x + 2y) = 12x² + 6xy</li>
<li>7x⁵(3x² + 11x + 5) = 21x⁷ + 77x⁶ + 35x</li>
</ol>
</section>
</main>
</body>
</html>
CSS:
* {
font-family: Arial, sans-serif;
font-size: 18px;
}
header {
border-bottom: 1px solid white;
margin-top: -10px;
text-align: center;
}
nav {
background-color: rgb(0, 84, 48);
color: white;
width: 200px;
position: fixed;
top: 0;
left: 0;
height: 100%;
overflow-y: auto;
padding-top: 20px;
}
.nav-link {
display: block;
text-decoration: none;
letter-spacing: 0.1rem;
color: white;
border-bottom: 1px solid white;
transition: background-color 0.3s;
padding: 10px 20px;
}
.nav-link:hover {
background-color: rgb(232, 199, 200);
color: #173837;
}
.main-section {
padding: 20px;
margin-left: 220px;
}
header {
font-size: 1.5em;
margin-top: 0;
}
@media (max-width: 768px) {
nav {
width: 100%;
height: auto;
position: relative;
}
.main-section {
margin-left: 0;
}
}
Then, it passed all of those tests except 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 even if I corrected my codes and yet, the error is still exactly the same.
Hope to understand.
Regards,
Mr. Jarod Yra Siangco