Technical Documentation Page - Build a Technical Documentation Page

**Greetings
I am not good with CSS, and I am a novice here. In my challenge, I am supposed to:

  1. 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

However, I really don’t know how to make it appear on the left by using CSS. Would someone please help understand what I am supposed to here and how to do it well so that my result looks like this: https://technical-documentation-page.freecodecamp.rocks

I have already passed the challenge, and submit the result. However, I want to continue to work on it for my own learning experience.
Thank you very much.

**

Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
  <link rel="stylesheet" href="styles.css"/>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>Technical Documentation Page</title>
  </head>
  <body>
    <main id="main-doc">
<section role="region" aria-labelledby="Introduction" class="main-section" id="Introduction">
  <header class="bold">Introduction</header>
  <p>JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a host environment (for example, a web browser), JavaScript can be connected to the objects of its environment to provide programmatic control over them.</p>
  <p>JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objectsj; for example: </p>
  <ul>
    <li>Client-side JavaScript extends the core language by supplying objects to control a browser and its Document Object Model (DOM). For example, client-side extentions allow an application to place elements on an HTML  form and respond to user events such as mouse clicks, form input, and page navigation.</li>
    <li>Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.</li>
  </ul>
</section>
<section class="main-section" role="region" aria-labelledby="What_you_should_already_know" id="What_you_should_already_know">
  <header class="bold">What you should already know</header>
  <p>This guide assumes you have the following basic background:</p>
  <ul>
    <li>A general understanding of the internet and the World Wide Web (WWW).</li>
    <li>Good working knowledge of HyperText markup Language (HTML).</li>
    <li>Some programming experience. If you are new to programming, try one of the tutorials linked on the main page of JavaScript.</li>
  </ul>
</section>
<section class="main-section" role="region" aria-labelledby="JavaScript and Java" id="JavaScript_and_Java">
  <header class="bold">JavaScript and Java</header>
  <p>JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.</p>
</section>
<section class="main-section" role="region" aria-labelledby="Hello world" id="Hello_world"> 
  <header class="bold">Hello world</header>
  <p>To get started with writing JavaScript, open the Scratchpad and write your first "Hello world" JavaScript code:</p>
  <code>function greetMe(yourName) {alert("Hello " + yourName); }
    greetMe("World"); </code>
  <p>Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!</p>
</section>
<section class="main-section" role="region" aria-labelledby="Variables" id="Variables">
  <header class="bold">Variables</header>
  <p>You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules.</p>
  <p>A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters incled the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase). </p>
</section>
<section class="main-section" role="region" aria-labelledby="Declaring variables" id="Declaring_variables">
  <header class="bold">Declaring variables</header>
  <p>You can declare a variable in three ways:</p>
  <p>With the keyword var. For example,</p>
  <code>var x = 42.</code>
  <p>This syntax can be used to declare both local and global variables.</p>
  <p>By simply assigning it a value. For example,</p>
  <code> x = 42. </code>
  <p>This always declares a global variable. It generates a strict JavaScript warning. YOu shouldn't use this variant.</p>
  <p>With the keyword let. For example.</p>
  <code>let y = 13.</code>
  <p>This syntax can be used to declare a block scope local variable. See Variable scope below.</p>
</section>
<section class="main-section" role="region" aria-labelledby="Variable scope" id="Variable_scope">
  <header class="bold">Variable scope</header>
  <p>When you declare a variable outside of any function, it is called a global variable, because it is available to any other code in the current document. When you declare a variable within a function, it is called a local variable, because it is available only within that function.</p>
  <p>JavaScript before ECMAScript 2015 does not have block statement scope; rather,a variable declared within a block is local to the function (or global scope) that the block resides within. For example the following code will log 5, because the scope of x is the function (or global context) within which x is declared, not the block, which in this case is an if statement.</p>
  <code>if(true) {var x = 5; } console.log(x); // 5 </code>
  <p>This behavior changes, when using the let declaration introduced in ECMAScript 2015</p>
  <code>if (true) {let y = 5; } console.log(y); //
    ReferenceError: y is
    not defined </code>
</section>
<section class="main-section" role="region" aria-labelledby="Global variables" id="Global_variables">
  <header class="bold">Global variables</header>
  <p>Global variables are in fact properties of the global object. In web pages the global object is window, so you can set and access global variables using the window variable syntax.</p>
  <p>Consequently, you can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if variable called phoneNumber is declared in a document, you can refer to this variable from an iframe as parent.phoneNumber.</p>
</section>
<section class="main-section" role="region" aria-labelledby="Reference" id="Reference">
  <header>Reference</header>
  <ul>
    <li>All the documentation in this p age is taken from <!--find out what MDN stands for and the hyperlink for it-->MDN</li>
  </ul>
</section>
<nav id="navbar">
  <header class="bold">JS Documentation</header>
  <ul>
 <li><a href="#Introduction" class="nav-link">Introduction</a></li>
 <li><a class="nav-link" href="#What_you_should_already_know">What you should already know</a></li>
 <li><a class="nav-link" href="#JavaScript_and_Java">JavaScript and Java</a></li>
 <li><a class="nav-link" href="#Hello_world">Hello world</a></li>
 <li><a class="nav-link" href="#Variables">Variables</a></li>
 <li><a class="nav-link" href="#Declaring_variables">Declaring variables</a></li>
 <li><a class="nav-link" href="#Variable_scope">Variable Scope</a></li>
 <li><a class="nav-link" href="#Global_variables">Global variables</a></li>
 <li><a class="nav-link" href="#Reference">Reference</a></li>

 
  </ul>
</nav>
    </main>
  </body>
</html>

CSS code

html{max-width: 800px;
min-width: 250px;
width: 100%;
}

head{}

body{}

p{margin: 10px;
padding: 10px;
font-size: 17px;}

li{padding: 6px;}

header{padding-top: 10px;
padding-bottom: -1px;
margin: 5px;
text-align: center;
font-size: 30px;
font-weight: bold;
font-family: Tahoma, sans-serif;}

code {background-color: #ffff9f;
 horizontal-width: 30px; 
 height: 10px;
 padding: 10px;
 margin: 10px;
 }
 
@media (prefers-reduced-motion: no-preference) {
  * {
    scroll-behavior: smooth;
  }
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.50

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

I would first put the #navbar above the #main-doc.

Then there are some css styles to help you set the nav towards the left.
I have created a codepen to show you how you can make a nav on the left of the screen.

This is a simple way to make the nav appear on the left of the screen

Excellent!! Thank you very much. I appreciate the help.

Ciao!

1 Like