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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <html>
  <head>
  <title> Basic HTML Tags </title>
  </head>
  <nav id="navbar">
      <div class="flex-cont">
   <header>
      <div id="nav-header">
        <h1 style="font-size: 20px; text-align: center;"> Basic HTML Tags</h1>  
        <h2 style="font-size: 12px; padding: 0 10px;">Get Started With HTML</h2>
      </div>
   </header>
      <div id="navs">
        <ul id="linkage">
          <a href="#Form" class="nav-link"><li>Form</li></a>
          <a href="#Button" class="nav-link"><li>Button</li></a>
          <a href="#Links" class="nav-link"><li>Links</li></a>
          <a href="#Heading" class="nav-link"><li>Heading</li></a>
          <a href="#Body" class="nav-link"><li>Body</li></a>
          <a href="#Paragraph" class="nav-link"><li>Paragraph</li></a>
          <a href="#Input" class="nav-link"><li>Input</li></a>
        </ul>
      </div>
      </div>
  </nav>
<body>
  <main id="main-doc">
    <section class="main-section" id="Form">
      <header> <h2>Form</h2> </header>
      <p>The "< form >" tag is used to create an HTML form for user input.</p>
      <code> < form> + inputs tags + paragraph tags + other tags + < /form> </code>
      <p></p>
    </section>
    <section class="main-section" id="Button">
      <header> <h2>Button</h2> </header>
      <p>The "< button >" tag defines a clickable button.</p>
      <p></p>
      <code>  < button type="button"> Click Me! < /button> </code>
    </section>
    <section class="main-section" id="Links">
      <header> <h2>Links</h2> </header>
      <p>The "< a >" tag defines a hyperlink, which is used to link from one page to another.</p>
      <p></p>
      <code> < a href="https://www.w3schools.com">Visit W3Schools.com!< /a> </code>
    </section>
    <section class="main-section" id="Heading">
      <header> <h2>Heading</h2> </header>
      <p>The "< header >" element represents a container for introductory content or a set of navigational links.</p>
      <p></p>
      <code> < header> <br><br>
  < h1> Main page heading here < /h1> <br><br>
  < p> Posted by John Doe < /p> <br><br>
< /header> </code>
    </section>
    <section class="main-section" id="Body">
      <header> <h2>Body</h2> </header>
      <p>The "< body >" tag defines the document's body.</p>
      <p></p>
      <code> 
        < html><br>
< head><br>
  < title> Title of the document < /title><br>
< /head><br>

< body><br>
  < h1> This is a heading < /h1><br>
  < p> This is a paragraph. < /p><br>
< /body><br>

< /html><br> </code>
    </section>
    <section class="main-section" id="Paragraph">
      <header> <h2>Paragraph</h2> </header>
      <p>The "< p >" tag defines a paragraph.</p>
      <p></p>
      <code> < p style="text-align:right" > This is some text in a paragraph.< /p> </code>
    </section>
    <section class="main-section" id="Input">
      <header> <h2>Input</h2> </header>
      <p>The "< input > " tag specifies an input field where the user can enter data.</p>
      <p></p>
      <code> < form action="/action_page.php"><br><br>
  < label for="fname">First name:< /label><br><br>
  < input type="text" id="fname" name="fname"> <br><br>
  < label for="lname">Last name:< /label> <br><br>
  < input type="text" id="lname" name="lname"> <br><br>
  < input type="submit" value="Submit">
< /form></code>
    <h3> Input Types</h3>
    <ul>
      <li> type="button</li>      <li>type="checkbox</li>
      <li> type="color"</li>
      <li> type="date"</li>
      <li> type="datetime-local"</li>
      <li> type="email"</li>
      <li> type="file" </li>
      <li> type="hidden</li>
      <li> type="image"</li>    
      <li> type="month"</li>
      <li> type="number</li>
      <li> type="password"</li>
      <li> type="radio"</li>
      <li> type="range"</li>
      <li> type="reset"</li>
      <li> type="search</li>
      <li> type="submit</li>
      <li> type="tel"</li>
      <li> type="text"</li>
      <li> type="time"</li>
      <li> type="url"</li>
      <li> type="week"></li>
    </ul>
    </section>
   <div id="learn"> <a href="https://www.w3schools.com/"><button>Learn More!</button></a></div>
     </main>
    
          <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
</body>
</html>
              
            
!

CSS

              
                .flex-cont {
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-color: green;
  position: fixed;
  left: 0;
  top: 0;
  color: white;
}
a > li {
  color: white;
  padding:0 0 15px 0;
}

#header-img{
  width: 150px;
  display: block;
  margin: 0 auto;
}

#main-doc{
  margin: 0 0 30px 175px;
  
}

code{
  width: 80%;
  background-color: #f1f1f1;
  padding: 30px;
  display: block;
  margin: 0 auto;
  color: red;
}

@media screen (max-width: 500px){
  .flex-cont{
    width: 100%;
  display: flex;
  flex-direction: rows;
  align-items: flex-start;
  background-color: green;
  position: fixed;
  left: 0;
  top: 0;
  color: white;
  }
  #navbar{
    position: fixed;
  }
}
#navbar{
  position: fixed;
}

button{
  width: auto;
  padding: 15px;
  color: white;
  background-color: green;
  border-radius: 35px;
  font-size: 20px;
  display: block;
  margin: 0 auto;
}

a{
  text-decoration: none;
}
              
            
!

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