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

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

<nav id="navbar">
  <header>Bootstrap Documentation Page</header>
  <ul>
    <li><a class="nav-link" href="#introduction">Introduction</a></li>
    <li><a class="nav-link" href="#starter_template">Starter Template</a></li>
    <li><a class="nav-link" href="#important_globals">Important Globals</a></li>
    <li><a class="nav-link" href="#responsive_meta_tag">Responsive meta Tag</a></li>
    <li><a class="nav-link" href="#box_sizing">Box Sizing</a></li>
    <li><a class="nav-link" href="#community">Community</a></li>
  </ul>
  </nav>
<main id="main-doc">
  <section class="main-section" id="introduction">
    <header>Introduction</header>
    <article>
      <p>
        Bootstrap is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with our Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful plugins built on jQuery.
        </p>
        
        <em>Get Started</em>
        <p>
          Get started with Bootstrap, the world’s most popular framework for building responsive, mobile-first sites, with BootstrapCDN and a template starter page.
          </p>
      
         <em>Quick Start</em>
          <p>
            Looking to quickly add Bootstrap to your project? Use BootstrapCDN, provided for free by the folks at StackPath. Using a package manager or need to download the source files?<a href="https://getbootstrap.com/docs/4.3/getting-started/download/"> Head to the downloads page</a>.
          </p>
           
           <em>CSS</em>
           <p>
             Copy-paste the stylesheet link into your head before all other stylesheets to load our CSS.
             
             <code>&lt;link rel="stylesheet"</br> href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"</br> integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"</br> crossorigin="anonymous"&gt;
</code>
           </p>
             
            <em>JS</em>
            <p>
           Many of our components require the use of JavaScript to function. Specifically, they require <a href="https://jquery.com/">jQuery</a>,<a href="https://popper.js.org/"> Popper.js</a>, and our own JavaScript plugins. Place the following scripts near the end of your pages, right before the closing <code>body</code> tag, to enable them. jQuery must come first, then Popper.js, and then our JavaScript plugins.

We use <a href="https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/">jQuery’s slim build</a>, but the full version is also supported.
            </p>
      
            <p>
              Curious which components explicitly require jQuery, our JS, and Popper.js? Click the show components link below. If you’re at all unsure about the general page structure, keep reading for an example page template.

Our bootstrap.bundle.js and bootstrap.bundle.min.js include <a href="https://popper.js.org/">Popper</a>, but not <a href="https://jquery.com/">jQuery</a>. For more information about what’s included in Bootstrap, please see our <a href="https://getbootstrap.com/docs/4.3/getting-started/contents/#precompiled-bootstrap">contents</a> section.
              
             </p>
      </article>
    </section>
  <section class="main-section" id="starter_template">
    <header>Starter Template</header>
    <article>
      <p>
        Be sure to have your pages set up with the latest design and development standards. That means using an HTML5 doctype and including a viewport meta tag for proper responsive behaviors.
       </p>
      <p>
        Visit <a href="https://getbootstrap.com/docs/4.3/layout/overview/">Layout docs</a> or <a href="https://getbootstrap.com/docs/4.3/examples/">the official examples</a> to start laying out your site’s content and components.
        </p>
      </article>
    </section>
  <section class="main-section" id="important_globals">
    <header>Important globals</header>
    <article>
      <p>
        Bootstrap employs a handful of important global styles and settings that you’ll need to be aware of when using it, all of which are almost exclusively geared towards the normalization of cross browser styles. Let’s dive in.
        </p>
      <em>HTML5 doctype</em>
      <p>
        Bootstrap requires the use of the HTML5 doctype. Without it, you’ll see some funky incomplete styling, but including it shouldn’t cause any considerable hiccups.
        <code>
       &lt;!doctype html&gt;</br> 
        &lt;html lang=&quot;en&quot;&gt;</br> 
        ...</br> 
        &lt;/html&gt;
        </code>
      </p>
      </article>
    </section>
  <section class="main-section" id="responsive_meta_tag">
    <header>Responsive meta tag</header>
    <article>
      <p>
        Bootstrap is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your <code>&lt;head&gt;</code>
        <p><code>content=&quot;width=device-width, initial-scale=1, shrink-to-fit=no&quot;&gt;</code></p>
      </p>
      </article>
    </section>
  <section class="main-section" id="box_sizing">
    <header>Box sizing</header>
    <article>
      <p>
        For more straightforward sizing in CSS, we switch the global box-sizing value from content-box to border-box. This ensures padding does not affect the final computed width of an element, but it can cause problems with some third party software like Google Maps and Google Custom Search Engine.

On the rare occasion you need to override it, use something like the following:
      </p>
      <p>
        <code>.selector-for-some-widget {
  box-sizing: content-box;
}</code>
      </p>
      <p>With the above snippet, nested elements—including generated content via ::before and ::after—will all inherit the specified box-sizing for that .selector-for-some-widget.

Learn more about <a href="https://css-tricks.com/box-sizing/">box model and sizing at CSS Tricks</a>.</p>
      </article>
    </section>
  <section class="main-section" id="community">
    <header>Community</header>
    <article>
      <p>
        Stay up to date on the development of Bootstrap and reach out to the community with these helpful resources.
      </p>
      <p>
        <ul>
 <li> Follow <a href="https://twitter.com/getbootstrap">@getbootstrap on Twitter</a>.</li>
<li>Read and subscribe to <a href="https://blog.getbootstrap.com/">The Official Bootstrap Blog</a>.</li>
<li>Join <a href="https://bootstrap-slack.herokuapp.com/">the official Slack room</a>.</li>
<li>Chat with fellow Bootstrappers in IRC. On the irc.freenode.net server, in the ##bootstrap channel.
Implementation help may be found at Stack Overflow (tagged bootstrap-4).</li>
<li>Developers should use the keyword bootstrap on packages which modify or add to the functionality of Bootstrap when distributing through npm or similar delivery mechanisms for maximum discoverability.</li>
          </ul>
      </p>
      </article>
    </section>
  </main>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,500);

html,
body {
  min-width: 290px;
  color: #4d4e53;
  background-color: #ffffff;
  font-family: 'Raleway', Arial, sans-serif;
  line-height: 1.5;
}

#navbar {
  position: fixed;
  min-width: 290px;
  top: 0px;
  left: 0px;
  width: 300px;
  height: 100%;
  border-right: solid;
  border-color: rgba(0, 22, 22, 0.4);
}

header {
  color: black;
  margin: 10px;
  text-align: center;
  font-size: 1.8em;
  font-weight: thin;
}

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

#navbar ul{
  height: 88%;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#navbar li {
  color: #4d4e53;
  border-top: ;
  list-style: none;
  position: relative;
  width: 100%;
}

#navbar a {
  display: block;
  padding: 10px 30px;
  color: #4d4e53;
  text-decoration: none;
  cursor: pointer;
}

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

section article {
  color: #4d4e53;
  margin: 15px;
  font-size 2em;
}

section li {
  margin: 15px 0px 0px 20px;
}

code {
   display: block;
   text-align: left;
   white-space: pre;
  position: relative;
  word-break: normal;
  line-height: 2;
  background-color:  #f7f7f7;
  padding: 25px;
  margin: 10px;
  border-radius: 5px;
}

@media only screen and (max-width: 815px) {
  #navbar ul {
    border: ;
    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: ;
  }
  
  #main-doc {
    position: relative;
    margin-left: 0px;
    margin-top: 270px;
  }
}

@media onlyscreen and (max-width: 400px) {
  #main-doc {
    margin-left: -10px;
  }
  
  html,
body {
  min-width: 290px;
  color: #4d4e53;
  background-color: #ffffff;
  font-family: "Open Sans", Arial, sans-serif;
  line-height: 1.5;
}

#navbar {
  position: fixed;
  min-width: 290px;
  top: 0px;
  left: 0px;
  width: 300px;
  height: 100%;
  border-right: solid;
  border-color: rgba(0, 22, 22, 0.4);
}

header {
  color: black;
  margin: 10px;
  text-align: center;
  font-size: 1.8em;
  font-weight: thin;
}

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

#navbar ul {
  height: 88%;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#navbar li {
  color: #4d4e53;
  border-top: 1px solid;
  list-style: none;
  position: relative;
  width: 100%;
}

#navbar a {
  display: block;
  padding: 10px 30px;
  color: #4d4e53;
  text-decoration: none;
  cursor: pointer;
}

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

section article {
  color: #4d4e53;
  margin: 15px;
  font-size: 0.96em;
}

section li {
  margin: 15px 0px 0px 20px;
}

code {
  display: block;
  text-align: left;
  white-space: pre;
  position: relative;
  word-break: normal;
  word-wrap: normal;
  line-height: 2;
  background-color: #f7f7f7;
  padding: 15px;
  margin: 10px;
  border-radius: 5px;
}

@media only screen and (max-width: 815px) {
  /* For mobile phones: */
  #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: 270px;
  }
}

@media only screen and (max-width: 400px) {
 /* #navbar {
    position: fixed;
  } */
  #main-doc {
    margin-left: -10px;
   
  }

  code {
    margin-left: -20px;
    width: 100%;
    padding: 50px;
    padding-left: 10px;
    padding-right: 45px;
    min-width: 233px;
  }
}
}
              
            
!

JS

              
                
              
            
!
999px

Console