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

              
                <div class="body">
<nav id="navbar">
  <header>CSS Documentation</header>
  <a href="#css tutorial" h2 class="tutorial">CSS Tutorial</a>
  <a href="#css introduction" h2 class="introduction">CSS Introduction</a>
  <a href="#css syntax" h2 class="syntax">CSS Syntax</a>
  <a href="#css selectors" h2 class="selectors">CSS Selectors</a>
  <a href="#how to add css"  h2 class="add">How To Add CSS</a>
</nav>
<main id="main-doc">
  <section class="main-section" id="css tutorial">
    <h2 class="tutorial">CSS Tutorial</h2>
    <p>CSS Examples</p>
    <p>Learn from over 300 examples! With our editor, you can edit the CSS, and click on a button to view the result.</p>
    <p>We recommend reading this tutorial, in the sequence listed in the menu.</p>
    <p>If you have a large screen, the menu will always be present on the left.</p>
    <p>If you have a small screen, open the menu by clicking the top menu sign ☰.</p>
  </section>
  <section class="main-section" id="css introduction">
    <h2 class="introduction">CSS Introduction</h2>
    <p>What is CSS?</p>
    <ul>
      <li>CSS stands for Cascading Style Sheets</li>
      <li>CSS describes how HTML elements are to be displayed on screen, paper, or in other media</li>
      <li>CSS saves a lot of work. It can control the layout of multiple web pages all at once</li>
      <li>External stylesheets are stored in CSS files</li>
    </ul>
    <p>Why Use CSS?</p>
    <p>CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.</p>
    <p>The style definitions are normally saved in external .css files.</p>
    <p>With an external stylesheet file, you can change the look of an entire website by changing just one file!</p>
  </section>
  <section class="main-section" id="css syntax">
    <h2 class="syntax">CSS Syntax</h2>
    <p>The selector points to the HTML element you want to style.
The declaration block contains one or more declarations separated by semicolons.</p>
    <p>Each declaration includes a CSS property name and a value, separated by a colon.
Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces.</p>
    <p>Example Explained</p>
    <ul>
      <li>p is a selector in CSS (it points to the HTML element you want to style: p).</li>
      <li>color is a property, and red is the property value</li>
      <li>text-align is a property, and center is the property value</li>
    </ul>
  </section>
  <section class="main-section" id="css selector">
    <h2 class="selectors">CSS Selectors</h2>
    <p>CSS selectors are used to "find" (or select) the HTML elements you want to style.
We can divide CSS selectors into five categories:</p>
    <ul>
      <li>Simple selectors (select elements based on name, id, class)</li>
      <li>Combinator selectors (select elements based on a specific relationship between them)</li>
      <li>Pseudo-class selectors (select elements based on a certain state)</li>
    </ul>
    </section>
  <section class="main-section" id="how to add css">
    <h2 class="add">How To Add CSS</h2>
    <p>With an external style sheet, you can change the look of an entire website by changing just one file!</p>
    <p>An external style sheet can be written in any text editor, and must be saved with a .css extension.
The external .css file should not contain any HTML tags.</p>
    <p>An internal style sheet may be used if one single HTML page has a unique style.
The internal style is defined inside the style element, inside the head section.</p>
  </section>
</main>
  </div>
              
            
!

CSS

              
                div.body {
  display: flex;
  flex-direction: row;
 padding: 0px;
  height: 100%;
  
}
#navbar {
  height: 5px;
  padding: 10px;
  border: 3px solid black;
  text-align: center;
  margin: 0px;
  position: center;
  background: #c9c2c1;
}
nav#navbar a {
  margin: 10px;
  padding: 20px;
  display: block;
  border: 1px solid black;
  text-decoration: none;
  color: black ;
  width: 200px;
  height: 10px;
  
  
}
main#main-doc {
  display: block;
  margin: 20px;
  padding: 5px;
}
header {
    font-weight: bold;
}
li {
  background: #c9c2c1;
  padding: 10px;
}
.tutorial {
  background: #e3e1e1;
}
.introduction {
  background: #e3e1e1;
}
.syntax {
   background: #e3e1e1;
}
.selectors {
  background: #e3e1e1; 
}
.add {
   background: #e3e1e1;
}
              
            
!

JS

              
                
              
            
!
999px

Console