css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="style.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
    <title>Basic HTML and HTML5</title>
  </head>

  <nav id="navbar">
    <header>Basic HTML and HTML5</header>
    <ul>
      <a class="nav-link" href="#Introduction_to_HTML5_Elements"><li>Introduction to HTML5 Elements</li></a>
      <a class="nav-link" href="#Add_image_to_your_html"><li>Add image to your html</li></a>
      <a class="nav-link" href="#Link_to_External_Pages"><li>Link to External Pages</li></a>
      <a class="nav-link" href="#Link_to_Internal_Pages"><li>Link to Internal Pages</li></a>
      <a class="nav-link" href="#Turn_an_Image_into_a_Link"><li>Turn an Image into a Link</li></a>
      <a class="nav-link" href="#Create_a_Bulleted_Unordered_List"><li>Create a Bulleted Unordered List</li></a>
      <a class="nav-link" href="#Create_a_Bulleted_Ordered_List"><li>Create a Bulleted Ordered List</li></a>
      <a class="nav-link" href="#Create_a_Form_Element"><li>Create a Form Element</li></a>
      <a class="nav-link" href="#Reference"><li>Reference</li></a>
    </ul>

  </nav>

  <main id="main-doc">

    <section class="main-section" id="Introduction_to_HTML5_Elements">

      <header>Introduction to HTML5 Elements</header>
      <p>HTML5 introduces more descriptive HTML tags. These include:</p>
      <div class="container">
        <ul>
          <li>header</li>
          <li>footer</li>
          <li>nav</li>
          <li>video</li>
          <li>article</li>
          <li>section</li>
        </ul>
      </div>
      <p>These tags make your HTML easier to read, and also help with Search Engine Optimization (SEO) and accessibility.</p>
      <p>The HTML <strong>< main ></strong> element represents the dominant content of the <strong>< body ></strong> of a document, portion of a document or application. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.</p>
    </section>

    <section class="main-section" id="Add_image_to_your_html">

      <header>Add image to your html</header>
      <p>You can add images to your website by using the img element, and point to a specific image's URL using the src attribute:</p>
      <code>< img src="https://www.your-image-source.com/your-image.jpg" ></code>
      <p>All img elements must have an alt attribute. The text inside an alt attribute is used for screen readers to improve accessibility and is displayed if the image fails to load.</p>
      <p><strong>Note:</strong> If the image is purely decorative, using an empty alt attribute is a best practice.</p>
    </section>

    <section class="main-section" id="Link_to_External_Pages">

      <header>Link to External Pages</header>
      <p>You can use anchor elements to link to content outside of your web page. Anchor elements need a destination web address called href attribute. They also need anchor text. Here's an example:</p>
      <code>< a href="https://freecodecamp.org">this links to freecodecamp.org< /a ></code>
      <p> the major search engines use many metrics to determine the value of external links. Some of these metrics include:</p>
      <ul>
        <li>The trustworthiness of the linking domain.</li>
        <li>The popularity of the linking page.</li>
        <li>The relevancy of the content between the source page and the target page.</li>
        <li>The anchor text used in the link.</li>
        <li>The number of links to the same page on the source page.</li>
        <li>The number of root domains that link to the target page.</li>
        <li>The amount of variations that are used as anchor text to links to the target page.</li>
        <li>The ownership relationship between the source and target domains.</li>
      </ul>
    </section>

    <section class="main-section" id="Link_to_Internal_Pages">
      <header>Link to Internal Pages</header>
      <p>To create an internal link, you assign a link's href attribute to a hash symbol # plus the value of the id attribute for the element that you want to internally link to, usually further down the page. You then need to add the same id attribute to the element you are linking to. An id is an attribute that uniquely describes an element. Below is an example of an internal anchor link and its target element:</p>
      <div>
        <code>< a href="#contacts-header">Contacts< /a ></code>
      </div>
      <div class="code_2lines">
        <code>< h2 id="contacts-header">Contacts< /h2 ></code>
      </div>
      <p>When users click the Contacts link, they'll be taken to the section of the webpage with the Contacts header element.</p>
    </section>

    <section class="main-section" id="Turn_an_Image_into_a_Link">

      <header>Turn an Image into a Link</header>
      <p>You can make elements into links by nesting them within an a element. Nest your image within an a element. Here's an example:</p>
      <code>< a href="#">< img src="https://bit.ly/fcc-running-cats" alt="Three kittens running towards the camera." >< /a ></code>
      <p>Remember to use # as you’re a element's href property in order to turn it into a dead link.</p>
    </section>

    <section class="main-section" id="Create_a_Bulleted_Unordered_List">

      <header>Create a Bulleted Unordered List</header>
      <p>HTML has a special element for creating unordered lists, or bullet point style lists. Unordered lists start with an opening <strong>< ul ></strong> element, followed by any number of <strong>< li ></strong> elements. Finally, unordered lists close with a <strong>< /ul ></strong></p>
      <p>For example:</p>
      <code>
        <ul>
          <li>milk</li>
          <li>cheese</li>
          <li>cuddle</li>
        </ul>
      </code>
      <p>Would create a bullet point style list of "milk" and "cheese".</p>
    </section>

    <section class="main-section" id="Create_a_Bulleted_Ordered_List">

      <header>Create a Bulleted Ordered List</header>
      <p>HTML has another special element for creating ordered lists, or numbered lists.</p>
      <p>Ordered lists start with an opening <strong>< ol ></strong> element, followed by any number of <strong>< li ></strong> elements. Finally, ordered lists close with a <strong>< /ol ></strong></p>
      <p>For example:</p>
      <code>
        <ol>
          <li>Garfield</li>
          <li>Sylvester</li>
        </ol>
      </code>

    </section>

    <section class="main-section" id="Create_a_Form_Element">

      <header>Create a Form Element</header>
      <p>You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your form element.</p>
      <p>For example:</p>
      <code>< form action="/url-where-you-want-to-submit-form-data" >< /form ></code>

    </section>

    <section class="main-section" id="Reference">
      <header>Reference</header>
      <ul>
        <li>All the documentation in this page is taken from <a href="https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5" target="_blank">freecodecamp.org</a></li>
      </ul>

    </section>
  </main>
</html>

            
          
!
            
              html,body{
    min-width:290px;
    font-family: 'Roboto Condensed', sans-serif;
    line-height: 1.8;
}

#navbar{
  background-color: black;
  position:fixed;
  min-width:290px;
  top:0px;
  left:0px;
  width:300px;
  height:100%;
  border:3px solid gray;
}

header{
  color:black;
  font-size: 25px;
  margin:15px;
  text-align:center;
  font-size:1.5em;
}

#navbar header{
  color: #adadad;
}

#navbar ul{
  height:90%;
}

#navbar li{
  color: #adadad;
  background-color: black;
  border:1px solid;
  border-width:2px;
  padding:8px;
  padding-left:30px;
  list-style: none;
  position:relative;
  left:-40px;
  width:100%;
}

#navbar li:hover{
  background-color: white;
  color: black;
}

#navbar a{
  text-decoration:none;
  cursor:pointer;
}

#main-doc{
  position: absolute;
  margin-left:300px;
  padding:20px;
  margin-bottom:110px;
}

#main-doc header{
  text-align:left;
  margin:0px;
}

.container ul{
  column-count: 3;
  column-gap: 0;
}

code{
  display:block;
  text-align: left;
  position: relative;
  background-color:#f7f7f7;
  padding:15px;
  margin:10px;
  border-radius:2px;
}

@media only screen and (max-width: 815px) {
  #navbar ul{
  border:1px solid;
    height:207px;
  }
    #navbar{
      background-color:white;
      position:absolute;
      top:0;
      padding:0;
      margin: 0;
      width:100%;
      max-height:275px;
      border:none;
      z-index:1;
      border-bottom:2px solid;
    }
  #main-doc{
    position: relative;
    margin-left:0px;
    margin-top: 500px;
  }
}
@media only screen and (max-width: 400px) {
  #main-doc{
    margin-left:-10px;
  }
  code{
    margin-left:-20px;
    width:100%;
    padding:15px;
    padding-left:10px;
    padding-right:45px;
    min-width:233px;
  }
}

            
          
!
            
              // !! 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
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console