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.

            
              <html>
    <head>
        <title>Html Basics Redesign</title>
        <link href="https://fonts.googleapis.com/css?family=Lato|Roboto|Thasadith" rel="stylesheet">
        <link href="styles.css" rel="stylesheet" type="text/css"/>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
    </head>
    <body>
      
        <nav id="navbar">
          <header id="nav-header">
            <h1>HTML Basics</h1>
          </header>
          <ul>
            <li><a href="#Introduction" class="nav-link">Introduction</a></li>
            <li><a href="#Html_Documents" class="nav-link">Html Documents</a></li>
            <li><a href="#Html_Elements" class="nav-link">Html Elements</a></li>
            <li><a href="#Html_Attributes" class="nav-link">Html Attributes</a></li>
            <li><a href="#Html_Headings" class="nav-link">Html Headings</a></li>
            <li><a href="#Html_Styles" class="nav-link">Html Styles</a></li>
            <li><a href="#Html_Formatting" class="nav-link">Html Formatting</a></li>
            <li><a href="#Html_Comments" class="nav-link">Html Comments</a></li>
          </ul>
        </nav>
        
        <main id="main-doc">
            <section class="main-section" id="Introduction">
                <header>
                    <h2>Introduction</h2>
                </header>
                <h3>What is HTML?</h3>
                <p>HTML is the standard markup language for creating Web pages.</p>
                <ul>
                    <li>HTML stands for Hyper Text Markup Language</li>
                    <li>HTML describes the structure of Web pages using markup</li>
                    <li>HTML elements are the building blocks of HTML pages</li>
                    <li>HTML elements are represented by tags</li>
                    <li>HTML tags label pieces of content such as "heading", "paragraph", "table", and so on</li>
                    <li>Browsers do not display the HTML tags, but use them to render the content of the page</li>
                </ul>
                <h3>A simple HTML document</h3>
                
                    <pre><code>
    &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;head&gt;
    &lt;title>Page Title&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;

    &lt;h1&gt;My First Heading&lt;/h1&gt;
    &lt;p&gt;My first paragraph.&lt;/p&gt;
    &lt;/body&gt;
    &lt;/html&gt;
                    </code></pre>
                
                <h3>Example explained</h3>
                <ul>
                    <li>The <code>&lt;!DOCTYPE html&gt;</code> declaration defines this document to be HTML5
                    <li>The <code>&lt;html&gt;</code> element is the root element of an HTML page</li>
                    <li>The <code>&lt;head&gt;</code> element contains meta information about the document</li>
                    <li>The <code>&lt;title&gt;</code> element specifies a title for the document</li>
                    <li>The <code>&lt;body&gt;</code> element contains the visible page content</li>
                    <li>The <code>&lt;h1&gt;</code> element defines a large heading</li>
                    <li>The <code>&lt;p&gt;</code> element defines a paragraph</li>
                </ul>

            </section>
        <hr>            
            <section class="main-section" id="Html_Documents">
                <header>
                    <h2>HTML Documents</h2>
                </header>
                <p>All HTML documents must start with a document type declaration: <!DOCTYPE html>.
                </p>
                <p>
                The HTML document itself begins with <code>&lt;html&gt;</code> and ends with <code>&lt;/html&gt;</code>.
                </p>
                <p>
                The visible part of the HTML document is between <code>&lt;body&gt;</code> and <code>&lt;/body&gt;</code>.
                </p>
                <h3>Example</h3>
                <pre><code>
    &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;body&gt;

    &lt;h1&gt;My First Heading&lt;/h1&gt;
    &lt;p&gt;My first paragraph.&lt;/p&gt;

    &lt;/body&gt;
    &lt;/html&gt;
                </code>
                </pre>
            </section>
        <hr>
            <section class="main-section" id="Html_Elements">
                <header>
                    <h2>HTML Elements</h2>
                </header>
                <p>An HTML element usually consists of a start tag and end tag, 
                    with the content inserted in between:
                </p>
                <code>&lt;tagname&gt;Content goes here...&lt;/tagname&gt;</code>
                <p>The HTML element is everything from the start tag to the end tag:</p>

                <code>&lt;p&gt;My first paragraph.&lt;/p&gt;</code>
                
                <h3>Nested HTML Elements</h3>
                <p>HTML elements can be nested (elements can contain elements).</p>

                <p>All HTML documents consist of nested HTML elements.</p>

                <p>This example contains four HTML elements:</p>
                
                <h3>Example</h3>
                <pre><code>
    &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;body&gt;

    &lt;h1&gt;My First Heading&lt;/h1&gt;
    &lt;p&gt;My first paragraph.&lt;/p&gt;

    &lt;/body&gt;
    &lt;/html&gt;
                </code></pre>
                
            </section>
        <hr>            
            <section class="main-section" id="Html_Attributes">
                <header>
                    <h2>HTML Attributes</h2>
                </header>
                <ul>
                    <li>All HTML elements can have attributes</li>
                    <li>Attributes provide additional information about an element</li>
                    <li>Attributes are always specified in the start tag</li>
                    <li>Attributes usually come in name/value pairs like: name="value"</li>
                </ul>
                
                <h3>The <code>href</code> attribute</h3>
                <p>HTML links are defined with the <code>&lt;a&gt;</code> tag. 
                    The link address is specified in the <code>href</code> attribute.
                </p>
                
                <h3>The <code>src</code> attribute</h3>
                <p>HTML images are defined with the <code>&lt;img&gt;</code> tag.</p>
                <p>The filename of the image source is specified in the <code>src</code> attribute.</p>
                
                <h3>The <code>alt</code> attribute</h3>
                <p>The <code>alt</code> attribute specifies an alternative text to be used, when an image cannot be displayed.</p>

                <p>The value of the attribute can be read by screen readers. This way, someone 
                    "listening" to the webpage, e.g. a vision impaired person, can "hear" the element.</p>
            </section>
         <hr>           
            <section class="main-section" id="Html_Headings">
                <header>
                    <h2>HTML Headings</h2>
                </header>
                <p>Headings are defined with the <code>&lt;h1&gt;</code> to <code>&lt;h6&gt;</code> tags. </p>

                <p><code>&lt;h1&gt;</code> defines the most important heading. <code>&lt;h6&gt;</code> defines the least important heading.</p>
                <h3>Headings Are Important</h3>
                <p>Search engines use the headings to index the structure and content of your web pages.</p>

                <p>Users skim your pages by its headings. It is important to use headings to show the document structure.</p>

                <p><code>&lt;h1&gt;</code> headings should be used for main headings, followed by <code>&lt;h2&gt;</code> headings, then the less important <code>&lt;h3&gt;</code>, and so on.</p>
                <h3>Bigger Headings</h3>
                <p>Each HTML heading has a default size. However, you can specify the size for any heading with the style attribute, using the CSS font-size property</p>
            </section>
        <hr>            
            <section class="main-section" id="Html_Styles">
                <header>
                    <h2>HTML Styles</h2>
                </header>
                <p>Setting the style of an HTML element, can be done with the style attribute.</p>

                <p>The HTML style attribute has the following syntax:</p>

                <code>&lt;tagname style="property:value;"&gt;</code>
                <p>The property is a CSS property. The value is a CSS value.</p>
                <h3>HTML Background Color</h3>
                <p>The <code>background-color</code> property defines the background color for an HTML element.</p>
                <h3>HTML Text Color</h3>
                <p>The <code>color</code> property defines the text color for an HTML element.</p>
                <h3>HTML Fonts</h3>
                <p>The <code>font-family</code> property defines the font to be used for an HTML element.</p>
                <h3>HTML Text Size</h3>
                <p>The <code>font-size</code> property defines the text size for an HTML element</p>
            </section>
        <hr>            
            <section class="main-section" id="Html_Formatting">
                <header>
                    <h2>HTML Formatting</h2>
                </header>

                <p>HTML also defines special elements for defining text with a special meaning.</p>

                <p>HTML uses elements like <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> for formatting output, like bold or italic text.</p>

                <p>Formatting elements were designed to display special types of text:</p>
                <ul>
                    <li><code>&lt;b&gt;</code> - Bold text</li>
                    <li><code>&lt;strong&gt;</code> - Important text</li>
                    <li><code>&lt;i&gt;</code> - Italic text</li>
                    <li><code>&lt;em&gt;</code> - Emphasized text</li>
                    <li><code>&lt;mark&gt;</code> - Marked text</li>
                    <li><code>&lt;small&gt;</code> - Small text</li>
                    <li><code>&lt;del&gt;</code> - Deleted text</li>
                    <li><code>&lt;ins&gt;</code> - Inserted text</li>
                    <li><code>&lt;sub&gt;</code> - Subscript text</li>
                    <li><code>&lt;sup&gt;</code> - Superscript text</li>
                </ul>
            </section>
        <hr>            
            <section class="main-section" id="Html_Comments">
                <header>
                    <h2>HTML Comments</h2>
                </header>
                <p>You can add comments to your HTML source by using the following syntax:</p>

                <code class='comment'>&lt;!-- Write your comments here --&gt;</code>
                <p>Notice that there is an exclamation point (!) in the opening tag, but not in the closing tag.</p>

                <p>Comments are not displayed by the browser, but they can help document your HTML source code.</p>

                <p>With comments you can place notifications and reminders in your HTML.</p>
                <p>Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors.</p>
            </section>
        
                  <footer>
          This is a student project focused on design. All contents were obtained from <a href="https://www.w3schools.com/html/default.asp">W3Schools</a>.
        </footer>
        
        </main>


        <a href="#nav-header" id="btn-up">
            <img src="https://image.flaticon.com/icons/svg/25/25216.svg" alt="back to top"/>
        </a>
        
    </body>
</html>

            
          
!
            
              html, body{
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Thasadith, Roboto, "Trebuchet MS", sans-serif;
}

body{
    display: flex;
}

a{
  text-decoration: none;
  color: #8360c3;
  font-weight: bolder;
}

nav{
    width: 200px;
    height: 100%;
    color: white;
    background-image: linear-gradient(#8360c3, #2ebf91);
    display: flex;
    flex-direction: column;
    padding-left: 50px;
    padding-top: 1em;
    position: fixed;
    font-weight:400;
    font-family: Lato;
    box-shadow: 5px 0 30px silver;
}


nav ul{
  list-style-type: none;
  margin: 0;
  padding: 0;
  height: 60%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

nav ul li{
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nav-link{
    padding: auto 0;
    color: white;
    text-decoration: none;
    margin-left: -5px;
    padding-left: 5px;
    
}

nav ul li:hover{
    border-right: 5px solid white;
}

main{
    padding-right: 5%;
    
}


.main-section:nth-last-child(2){
  padding-bottom: 3em;
}

.main-section:first-child header h2{
    margin-top: 0.5em;
}

.main-section{
    padding-left: 300px;
}

hr{
    border:1px solid #2ebf91;
    margin-left: 300px;
    margin-top: 3em;
}

h2{
    font-size: 3em;
}

code{
    color: #8360c3;
}

h3 code{
    color: black;
    font-size: 1.2em;
}


pre{
    border-left: 4px solid #2ebf91;
    background-image: linear-gradient(#f0f0f0, #f8f8f8);
}



#btn-up img{
    max-width: 20px;
    display: block;
    position: fixed;
    right: 20px;
    bottom: 20px;
    background-color: #bfd8d2;
    background-image: linear-gradient(#8360c3, #2ebf91);
    border-radius: 50%;
    padding: 10px;
    opacity: 0.8;
}

@media(min-width:850px){
    #btn-up{
    visibility: hidden;
    }
}

footer{
    display: block;
    background-image: linear-gradient(#f0f0f0, #f8f8f8);
    line-height: 2em;
    margin-left: 250px;
    margin-right: -5%;
    padding-left: 50px;
    position: fixed;
    bottom: 0;
    width: 100%;
  }

@media (max-width: 850px){
    nav{
    width: 100%;
    max-height: 300px;
    flex-direction: row;
    position: absolute;
    top: 0;
    padding: 0;
    }
    
    nav ul{
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
        width: 100%;
    }
    
    nav ul li{
        width: 100%;
        border-bottom: 1px solid white;
        padding-left: 10px;
    }
    
    nav ul li:hover{
        border-left: 5px white solid;
    }
    
    #nav-header{
        visibility: hidden;
        width: 0%;
    }
    
    main{
        margin-top: 300px;
    }
    
    .main-section{
        padding-left: 5%;
    }
  

    
    hr{
        margin-left: 5%;
    }
    
  footer{
    margin-left: 0;
    padding-left: 2%;
  }

}

@media (max-width: 600px){
  footer{
    position: static;
  }
}




            
          
!
            
              // !! 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.

Console