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

              
                <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML Technical Documentation Page</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div id="back_to_top"></div>
    <div class="page-container">
        <div class="nav-container">
            <nav id="navbar" class="nav">
                <header class="nav-title">HTML Documentation</header>
                <ul id="nav" class="nav-list nav-flex">
                    <li class="nav-item"><a class="nav-link" href="#introduction">Introduction</a></li>
                    <li class="nav-item"><a class="nav-link" href="#get_started">Get Started</a></li>
                    <li class="nav-item"><a class="nav-link" href="#hello_world">Hello World</a></li>
                    <li class="nav-item"><a class="nav-link" href="#html_elements">HTML Elements</a></li>
                    <li class="nav-item"><a class="nav-link" href="#html_attributes">HTML Attributes</a></li>
                    <li class="nav-item"><a class="nav-link" href="#html_styles">HTML Styles</a></li>
                    <li class="nav-item"><a class="nav-link" href="#html_formatting">HTML Formatting</a></li>
                    <li class="nav-item"><a class="nav-link" href="#html_comments">HTML Comments</a></li>
                    <li class="nav-item"><a class="nav-link" href="#html_references">HTML References</a></li>
                </ul>
            </nav>
        </div>
        <main id="main-doc">
            <section class="main-section" id="introduction">
                <header class="header-title">Introduction</header>
                <article>
                    <p>This documentation will provide you with some basics of HTML with some references at the end. HTML stands for Hyper Text Markup Language. HTML is used for the following:</p>
                    <ul>
                        <li class="introduction_content">the standard markup for creating web pages</li>
                        <li class="introduction_content">the structure of the web page</li>
                        <li class="introduction_content">telling the browser how to display content with the use of elements</li>
                    </ul>
                </article>
                <button onclick="topFunction()" id="backBtn"><a class="back_to_top" href="#back_to_top">&#8963;</a></button>
            </section>
            <section class="main-section" id="get_started">
                <header class="header-title">Get Started</header>
                <article>
                    <p>You do not need any previous experience to get started with HTML. All you need is a simple text editor like Notepad, and you can create a very basic website. HTML files have the .html extension attached to them.</p>
                    <p>There are many text editors out there like Visual Studio Code, a very popular tool for programmers and web developers. These editors are more advanced, have many useful features, and often are free.</p>
                </article>
            </section>
            <section class="main-section" id="hello_world">
                <header class="header-title">Hello World</header>
                <article>
                    <p>Let's create your first website. Open Notepad, and we will create Hello World. Hello World is where a lot of developers start out, regardless of the language their learning. HTML is not a programming language, but a structure language.</p>
                    <p>To create Hello World, simply type "Hello World." into your Notepad. Then save the file as index.html, or you can name it to whatever you like, as long as .html is in the extension name when you save the file. Index.html is most common
                        used for the homepage/landing page of a website, but you do not need to do it that way.</p>
                </article>
            </section>
            <section class="main-section" id="html_elements">
                <header class="header-title">HTML Elements</header>
                <article>
                    <p>HTML elements are the tag names and content within those tag names. The following code block is a basic structure of an HTML page. The tag names are between the greater than (>) and less than (
                        <) symbols. All content put between these tags are part of the HTML element.</p>
                            <pre class="html_elements--pre-container">
                                <code class="html_elements--code-container">
<span>&lt;html&gt;</span>
<span>&lt;head&gt;</span>
<span>meta and links, <br class="br_head">not on browser</span>
<span>&lt;/head&gt;</span>
<span>&lt;body&gt;</span>
<span>content on browser</span>
<span>&lt;/body&gt;</span>
<span>&lt;/html&gt;</span>
                                </code>
                            </pre>
                </article>
            </section>
            <section class="main-section" id="html_attributes">
                <header class="header-title">HTML Attributes</header>
                <article>
                    <p>HTML attributes provide additional information about HTML elements. Take the following tag and attribute:</p>
                    <pre class="html_attributes_a--pre-container">
                        <code class="html_attributes_a--code-container">
<p>&lt;a href=<br class="br_a">"https://example.com"&gt;<br class="br_a">&lt;/a&gt;</p>
                        </code>
                    </pre>
                    <p>The a is the anchor tag, and the href is the attribute that links to an address. In this instance, the href points to a website.</p>
                    <p>Another example is the src attribute on the img tag, as shown below. The src attribute links to where the image is stored (the path), and will then imbed on the page using that link path. Notice the img tag is self closing, so it does
                        not need the closing &lt;/img&gt; tag.</p>
                    <pre class="html_attributes_img--pre-container">
                        <code class="html_attributes_img--code-container">
<p>&lt;img src=<br class="br_img">"https://example.com/<br class="br_img">img1.jpg"&gt;</p>
                        </code>
                    </pre>
                </article>
            </section>
            <section class="main-section" id="html_styles">
                <header class="header-title">HTML Styles</header>
                <article>
                    <p>The HTML styles are imbedded CSS values used to style your webpage. Styles are added by using the &lt;style&gt; tag. The following shows an example on how to imbed a style. The property is a CSS property. The value is a CSS value.</p>
                    <pre class="html_styles--pre-container">
                        <code class="html_styles--code-container">
<p>&lt;tagname style=<br class="br_styles">"property:value;"<br class="br_styles">&gt;</p>
                        </code>
                    </pre>
                </article>
            </section>
            <section class="main-section" id="html_formatting">
                <header class="header-title">HTML Formatting</header>
                <article>
                    <p>HTML formatting is a way to give text special meaning and style. You can bold, italicize, and underline text with formatting. These are just a few of the formatting options you can do with text.</p>
                    <pre class="html_formatting--pre-container">
                        <code class="html_formatting--code-container">
                            <p>This is <b>bold</b> text. <br class="br_b">It is formatted by <br class="br_b">&lt;b&gt;&lt;/b&gt;.</p>
                            <p>This is <i>italicized</i> text. <br class="br_i">It is formatted by <br class="br_i">&lt;i&gt;&lt;/i&gt;.</p>
                            <p>This is <u>underlined</u> text. <br class="br_u">It is formatted by <br class="br_u">&lt;u&gt;&lt;/u&gt;.</p>
                        </code>
                    </pre>
                </article>
            </section>
            <section class="main-section" id="html_comments">
                <header class="header-title">HTML Comments</header>
                <article>
                    <p>HTML comments are comments that you can make in your HTML, that will not show up on the webpage. These are used to help reference and notate important parts or your code. You make a comment by doing the following:</p>
                    <pre class="html_comments--pre-container">
                        <code class="html_comments--code-container">
<p>&lt;!-- <br class="br_comments">Write comments here<br class="br_comments"> --&gt;</p>
                        </code>
                    </pre>
                    <P>Remember! Comment are not displayed in the web browser on your page. They are there to document and reference your code.</P>
                </article>
            </section>
            <section class="main-section" id="html_references">
                <header class="header-title">HTML References</header>
                <article>
                    <p>There are several references all over the Internet and YouTube for HTML tutorials. Below are a few of those resources. One of the most popular of the listed links is w3schools.</p>
                    <ul>
                        <li><a href="https://www.w3schools.com/html/default.asp">w3schools.com</a></li>
                        <li><a href="https://www.tutorialspoint.com/html/index.htm">tutorialspoint.com</a></li>
                        <li><a href="https://www.learn-html.org/">learn-html.org</a></li>
                    </ul>
                    </ul>
                    </ul>
                </article>
            </section>
        </main>
    </div>
    <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
    <script src="./main.js"></script>
</body>

</html>
              
            
!

CSS

              
                /* font-family: 'Roboto', sans-serif; */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    height: 100vh;
    text-align: center;
}

.page-container {
    margin: 0 auto;
    max-width: 1200px;
    width: 80%;
}

#backBtn {
    position: fixed;
    bottom: 1em;
    right: 1.5em;
    z-index: 99;
    border: none;
    outline: none;
    background-color: darkslategray;
    color: burlywood;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 10%;
    height: 7%;
    margin: 2em 2em 0em 2em;
}

#backBtn:hover {
    opacity: 0.7;
}

.back_to_top {
    text-decoration: none;
    color: burlywood;
    font-weight: 700;
    font-size: 1.75em;
}

.main-section {
    padding: 1em;
}

.header-title {
    padding: 0.50em 0em;
    background-color: darkslategray;
    font-weight: 700;
}

pre code {
    background-color: #eee;
    border: 1px solid #999;
    display: block;
    padding: 0;
    margin: 0;
}

.introduction_content {
    padding: 0.50em;
}


/* Nav Start */

.nav-container {
    background-color: darkslategray;
    padding: 1em 0;
}

.nav-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.nav-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .50em;
    padding: 1em 0 0 0;
    margin: 0;
}

.nav-list {
    list-style-type: none;
}

.nav-item {
    border-top: 2px solid black;
    padding: .25em 0;
    margin: 0;
    width: 100%;
}

.nav-link {
    text-decoration: none;
    color: burlywood;
}

.nav-link:hover,
.nav-link:focus {
    opacity: 0.7;
}


/* Nav End */


/* Media Queries */

@media (min-width: 700px) {
    .nav-container {
        display: block;
        position: fixed;
        left: 0;
        border-right: 10px solid gray;
        width: 30%;
        top: 0;
        bottom: 0;
    }
    .nav-list {
        visibility: visible;
        display: block;
    }
    .nav-item {
        padding: .75em 0;
    }
    #main-doc {
        width: 70%;
        position: absolute;
        right: 0;
    }
    #backBtn {
        width: 7%;
        height: 7%;
    }
    .br_a,
    .br_img,
    .br_styles {
        display: none;
        visibility: hidden;
    }
}
              
            
!

JS

              
                // const navToggle = document.querySelector('.mobile-nav-toggle');
// const nav = document.querySelector('.nav');


// navToggle.addEventListener('click', () => {
//     nav.classList.toggle('nav--visible');
// })

//Get the button
var backBtn = document.getElementById("backBtn");

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() { scrollFunction() };

function scrollFunction() {
    if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
        backBtn.style.display = "block";
    } else {
        backBtn.style.display = "none";
    }
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
}
              
            
!
999px

Console