Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- Section 1: nav bar -->
<nav id="navbar">
  <header id="header">
    <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAkFBMVEX33x4AAAD+5R+GeRByZw774x9ZUAv64R7/6B/u1x303B7izBtqYA3y2x0/OQitnBWQghFTSwq4phY4MwfUvxpEPQjm0ByyoRbZxBoqJgVKQwnOuhnBrhh7bw8nIwVPRwpjWQyaixOklBQWFAMeGwSKfRF1ag4LCgFkWgzFsRgiHwQvKwYUEgM8NgemlRSbjROjfARsAAAHC0lEQVR4nO2cW3uiOhRAybYxIFIQEa147c3xVO3//3cH67RHZQcShCaeb6+XeagwWeSe7MRxCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCDmcA7guOD2H5/8A56YThJAnsIhSQgV3g2QW9QfT0X64H00H/SjOPBcss4T1oFtg8FydSu5ODoNXds3LKMoAxC+kXBV4KCQypwNVj4lwiD14soxS1x7HWoYQRFK9E33fmnysYcid5wq/r1d4lt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="list-title"> <b>Javascript Documentation</b></span>
  </header>
  
  
  <ul>
    <li><a class="nav-link" 
         href="#java_script_introduction">Java Script Introduction</a>
    </li>
    
    <li>
      <a class="nav-link" 
         href="#what_you_need_to_know">What you need to know</a>
    </li>
   
    <li>
      <a class="nav-link" 
         href="#JavaScript_&_Java">JavaScript & Java</a>
    </li>
    
    <li><a class="nav-link" 
         href="#declaring_variables">Declaring Variables</a>
    </li>
    
    <li>
      <a class="nav-link" 
         href="#refrences">Refrences</a>
    </li>
     
  </ul>
  
</nav>

<!-- section 2: main -->
<main id="main-doc">
  <section id="java_script_introduction" class="main-section">
    <header><h1>Java Script Introduction<h1></header>
  
    <article>
      <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 objects; for
        example:
      </p>
     <code
        >function greetMe(yourName) { alert("Hello " + yourName); } greetMe("World");
      </code>
      
    </article>
  </section>

<section id="what_you_need_to_know" class="main-section">
    <header><h2>What you need to know<h2></header>
    <article>
      <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 about JavaScript.
        </li>
      </ul>
      <p> Here is a youtube video by <href="https://www.youtube.com/channel/UC-T8W79DN6PBnzomelvqJYw" target="_blank">James Q Quick</a>gives a more detailed explation of what you need to start learning Java Script:
        <br><br>
        
        <iframe width="560" height="315" src="https://www.youtube.com/embed/a00NRSFgHsY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    </article>
  </section>
      
      <section id="JavaScript_&_Java" class="main-section">
    <header><h2>JavaScript & Java<h2></header>
      <article>
        <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>

      <p>
        In contrast to Java's compile-time system of classes built by
        declarations, JavaScript supports a runtime system based on a small
        number of data types representing numeric, Boolean, and string values.
        JavaScript has a prototype-based object model instead of the more common
        class-based object model. The prototype-based model provides dynamic
        inheritance; that is, what is inherited can vary for individual objects.
        JavaScript also supports functions without any special declarative
        requirements. Functions can be properties of objects, executing as
        loosely typed methods.
      </p>
      <p>
        <b>Array</b>
        Accessing array elements
You can get elements out of arrays if you know their index. Array elements’ indices start at 0 and increment by 1, so the first element’s index is 0, the second element’s index is 1, the third element’s index is 2, etc.
      </p>
        <p>
          <b> Single Line Comment</b>
          Anything on the line following // will be a comment while anything before will still be code.</p>
        
        <p>
          <b>Functions</b>
          A function is a JavaScript procedure—a set of statements that performs a task or calculates a value.It is like a reusable piece of code. Imagine , having 20 for loops ,and then having a single function to handle it all . To use a function, you must define it somewhere in the scope from which you wish to call it. A function definition (also called a function declaration) consists of the function keyword, followed by the name of the function, a list of arguments to the function, enclosed in parentheses and separated by commas, the JavaScript statements that define the function, enclosed in curly braces, { }.</p>
       
        <p><b>Recap<b></p>
        <ul>
          <li>Array</li>
          <li>Single Line comment</li>
          <li>Function</li>
        </ul>
    </article>
  </section>
      
         <section id="declaring_variables" class="main-section">
    <header><h2>Declaring Variables<h2></header>
      <article>
      You can declare a variable in three ways:
      <p>
        With the keyword var. For example, <code>var x = 42.</code> This syntax
        can be used to declare both local and global variables.
      </p>
      <p>
        By simply assigning it a value. For example, <code>x = 42.</code> 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,<code> let y = 13.</code> This syntax
        can be used to declare a block scope local variable. See Variable scope
        below.
      </p>
         <p>Declaring Variables: You can declare a variable in three ways:
With the keyword var. For example</p>
      <pre><code class="css">      var x = 12.
      x = 12.
       let y = 13.
      }</code></pre>
    </article>
  </section>
      
       <section id="refrences" class="main-section">
    <header><h2>Refrences<h2></header>
     
        <article>
          <p>
            The information used in this webpage was found on <a href="https://www.freecodecamp.org/" target="_blank">freecodecamp.org</a>
            </p>
      <ul>
        <li>
          All the documentation in this page is taken from
          <a
            href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide"
            target="_blank"
            >MDN</a
          >
        </li>
      </ul>
    </article>
  </section>
</main>

              
            
!

CSS

              
                /* Font, colors, 
gray-color { 
	background: #d9dad7; 
}
	
.red-color { 
	background: #c24d2c; 
}

.navy-color { 
	background: #3e4a61; 
}

.dark-blue-color { 
	background: #1a2639; 
}

Font-family: Helvetica, sans-serif;

*/

/* sectionn 1: nav bar*/
html, body {
  min-width: 290px;
  color: #4d4e53;
  background-color: #d9dad7;
  font-family: 'Helvetica';
  line-height: 1.5;
}

header{
  margin: 1em;
  text-align: center;
  font-size: 20px;
  
}

header img{
  width: 50px;
  
}
#navbar {
  position: fixed;
  min-width: 100px;
  top: 0px;
  left: 0px;
  width: 360px;
  height: 100%;
  border-right: solid;
  border-color: #c24d2c;
 
}

ul{
  list-style: none;
  margin: 2em;
  text-align: left;
  
}
#navbar a {
  display: block;
  padding: 10px;
  color: #1a2639;
  text-decoration: none;
  cursor: pointer;
  text-align: left;  
}
  
@media (hover: hover) {
  a:hover {
    background: yellow;
  }
}

/* section 2: main */
#main-doc header {
  text-align: center;
  margin: 1px;
  color: #1a2639;
}
section article {
  color: #1a2639;
  margin: 15px;
  font-size: 0.96em;
  position: sticky;
  min-width: 800px;
  top: 60px;
  left: 400px;
  width: 300px;
}
code {
  display: block;
  text-align: left;
  white-space: pre-line;
  position: relative;
  word-break: normal;
  word-wrap: normal;
  line-height: 2;
  background-color: #f7f7f7;
  padding: 10px;
  margin: 10px;
  border-radius: 5px;
}

article {
  display: flex;
  flex-direction: column;
}
h1 {
  
 
}

h2{
  text-align: 
}

section article {
  margin: 15px;
  font-size: 0.96em;
}

iframe {
  display: block;
  margin: auto;
}
              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console