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

              
                    <main id="main-doc">
        <nav id="navbar">
            <header><h1>Technical Documentation</h1></header>
            <div class="line"></div>
            <ul>
                <li><a href="#section_number_1" class="nav-link">Section Number 1</a></li>
                <li><a href="#section_number_2" class="nav-link">Section Number 2</a></li>
                <li><a href="#section_number_3" class="nav-link">Section Number 3</a></li>
                <li><a href="#section_number_4" class="nav-link">Section Number 4</a></li>
                <li><a href="#section_number_5" class="nav-link">Section Number 5</a></li>
            </ul>
        </nav>
        <section class="main-section" id="section_number_1">
            <header><h2>Section Number 1</h2></header>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam quibusdam iure dicta? Nam, repellat libero? Ducimus voluptates corporis voluptatem molestias facilis quis velit, deleniti reprehenderit repellendus perferendis doloribus quia nam.</p>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam quibusdam iure dicta? Nam, repellat libero? Ducimus voluptates corporis voluptatem molestias facilis quis velit, deleniti reprehenderit repellendus perferendis doloribus quia nam.</p>
            <div class="cd_area">
                <pre>
                    <code>
#include &#60;iostream&#62;
int main()
{
    std::cout &#60;&#60; "Hello, user!";
    return 0;
}
                    </code>
                </pre>
            </div>
            <ul>
                <li>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</li>
                <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ratione, eligendi possimus.</li>
            </ul>
            
        </section>
        <section class="main-section" id="section_number_2">
            <header><h2>Section Number 2</h2></header>
            <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Doloribus quisquam placeat minus quas consequuntur a veritatis beatae dolore velit provident.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Temporibus maiores nobis explicabo! Accusantium, voluptatum error?</p>
            <div class="cd_area">
                <pre>
                    <code>
#include &#60;iostream&#62;
#include &#60;cstdlib&#62;
int main()
{
    std::cout &#60;&#60; "Hello, user!";
    return EXIT_SUCCESS;
}
                    </code>
                </pre>
            </div>    
            <ul>
                <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ea facere doloribus facilis asperiores quia consectetur suscipit inventore, iure, eaque laudantium voluptatum voluptas, sequi nesciunt sit soluta odio omnis reprehenderit. Cum?</li>
                <li>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dignissimos culpa quasi quod quis ipsum, quam eum.</li>
            </ul>
        </section>
        <section class="main-section" id="section_number_3">
            <header><h2>Section Number 3</h2></header>
            <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</p>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Corporis numquam dolores repudiandae corrupti rerum! Voluptatem dolorem sed voluptatibus nisi necessitatibus tempora totam, odit magnam aliquid optio iusto numquam quis esse repellat tempore qui!</p>
            <div class="cd_area">
                <pre>
                    <code>
#include &#60;iostream&#62;
#include &#60;cstdlib&#62;
#include &#60;string&#62;
int main()
{
    std::string user_name = "user";
    std::cout &#60;&#60; "Hello, " &#60;&#60; user_name &#60;&#60; "!" &#60;&#60; std::endl;
    user_name = "The Great Whale";
    std::cout &#60;&#60; "I am " &#60;&#60; user_name;
    return EXIT_SUCCESS;
}
                    </code>            
                </pre>
            </div>
            <ul>
                <li>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quas totam aliquid quisquam doloremque odit alias architecto. Magni impedit odio, nihil repudiandae a numquam, quasi reiciendis itaque nesciunt velit placeat quae!</li>
                <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore optio hic quo, praesentium deleniti, maxime ipsam fugit harum voluptas, beatae ut?</li>
            </ul>
        </section>
        <section class="main-section" id="section_number_4">
            <header><h2>Section Number 4</h2></header>
            <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aperiam voluptas in ad a.</p>
            <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quia, quidem at. Architecto ad in non nostrum odit ratione eos totam doloremque quae maiores! Sit fugiat sunt sequi neque?</p>
            <div class="cd_area">
                <pre>
                    <code>
#include &#60;iostream&#62;
#include &#60;cstdlib&#62;
int main()
{
    using namespace std;
    int a = 0, b = 0;
    cout &#60;&#60; "a = ";
    cin &#62;&#62; a;
    cout &#60;&#60; "b = ";
    cin &#62;&#62; b;
    cout &#60;&#60; "(a + 2b) (a - 2b) = ";
    cout &#60;&#60; (a + 2*b) * (a - 2*b) &#60;&#60; endl;
    return EXIT_SUCCESS;
}
                    </code>
                </pre>
            </div>
            <ul>
                <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Odit voluptatem incidunt suscipit eaque illo natus quam distinctio excepturi cupiditate architecto tenetur necessitatibus quas, iste molestiae harum mollitia cum quasi vel!</li>
                <li>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Hic tempora corporis quos beatae quas.</li>
            </ul>
        </section>
        <section class="main-section" id="section_number_5">
            <header><h2>Section Number 5</h2></header>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio in perspiciatis quaerat explicabo recusandae. At praesentium minus qui facere ipsam, atque quidem. Corporis sed ipsa accusamus deserunt error? Qui, consequatur explicabo.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor excepturi inventore enim voluptatem amet deleniti sit error quod?</p>
            <div class="cd_area">
                <pre>
                    <code> 
#include &#60;iostream&#62;
#include &#60;cstdlib&#62;
using namespace std;
int main()
{
    double x = 0;
    cout &#60;&#60; "x = ";
    cin &#62;&#62; x;
    cout &#60;&#60; "x*x ";
    if (x*x &#60; 2)
        cout &#60;&#60; " &#60; ";
    else
        cout &#60;&#60; " &#62; ";
    cout &#60;&#60; "2" &#60;&#60; endl;
    return EXIT_SUCCESS;
}
                </code>
            </pre>
            </div>
            <ul>
                <li>Lorem ipsum dolor sit amet consectetur.</li>
                <li>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo ea voluptatum perspiciatis reiciendis vitae dicta cupiditate facere impedit fugiat delectus et dolorum quaerat, accusantium architecto eaque, accusamus modi magni repudiandae!</li>
            </ul>
        </section>
        <section>
            <h2>References</h2>
            <p>I am not the author of the code examples. I found them on <a href="https://teccxx.neocities.org/mx1/cpp_listing_1.html">this page whith code examples.</a></p>
        </section>
    </main>

    <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
              
            
!

CSS

              
                * {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  background: #fee;
}

nav {
  height: 100%;
  background-color: #eee;
}

nav > ul {
  list-style: none;
}

a.nav-link {
  text-decoration: none;
  text-transform: uppercase;
  color: #212121;
  margin-bottom: 15px;
  padding: 5px;
  transition: ease 0.15s;
}

a.nav-link:hover {
  background: #888383;
  color: #fcf3f3;
}

section {
  margin-top: 15px;
  color: #212121;
}

section:last-child {
  margin-bottom: 15px;
}

p,
.cd_area {
  margin-top: 10px;
}

.cd_area {
  background: #fbdede;
  margin-bottom: 10px;
}

@media screen and (min-width: 768px) {
  section {
    margin-left: 300px;
  }

  .cd_area {
    margin-left: auto;
    margin-right: auto;
    width: 500px;
  }

  nav {
    position: fixed;
    left: 0;
    top: 0;
    border-right: 2px solid black;
  }

  h1 {
    border-bottom: 2px solid black;
    padding: 2px;
  }

  ul > li:first-child {
    margin-top: 15px;
  }

  nav > ul > li {
    text-align: center;
    margin-bottom: 15px;
    padding: 5px;
  }
}

@media screen and (max-width: 768px) {
  .cd_area {
    margin-left: auto;
    margin-right: auto;
    width: 50%;
  }

  nav {
    position: static;
    position: sticky;
    top: 0;
    border-bottom: 2px solid black;
  }

  h1 {
    text-align: center;
  }

  nav > ul {
    display: flex;
    justify-content: center;
    flex-direction: column;
    font-size: 12px;
  }
  
    nav > ul > li {
    text-align: center;
    margin-bottom: 10px;
    padding: 5px;
  }

  section {
    margin-left: 10px;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console