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

              
                <nav id=navbar>
  <header> Hypertext Markup Language (HTML) </header>
  <ul>
    <li><a class=nav-link href=#Introduction_to_HTML> Introduction to HTML</a></li>
    <li><a class=nav-link href=#Markup>Markup   </a></li>
    <li><a class=nav-link href=#Elements>Elements   </a></li>
      <li><a class=nav-link href=#Elements_examples>Elements examples  </a></li>
    <li><a class=nav-link href=#Attributes>Attributes</a></li>
    <li><a class=nav-link href=#Character_and_entity_references>Character and entity references</a></li>
    <li><a class=nav-link href=#Data_types>Data types</a></li>
    <li><a class=nav-link href=#Document_type_declaration>Document type declaration</a></li>
     <li><a class=nav-link href=#Reference>Reference</a></li>
  </ul>
</nav>

<main id=main-doc>

  <section class=main-section id=Introduction_to_HTML>
    <header> Introduction to HTML</header>
    <article>
      <p> Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.
      </p>
      <p> Web browsers receive HTML documents from a web server or from local storage and render the documents into multimedia web pages. HTML describes the structure of a web page semantically and originally included cues for the appearance of the document.
      </p>
      <p> HTML elements are the building blocks of HTML pages. With HTML constructs, images and other objects such as interactive forms may be embedded into the rendered page. HTML provides a means to create structured documents by denoting structural semantics
        for text such as headings, paragraphs, lists, links, quotes and other items. HTML elements are delineated by tags, written using angle brackets. Tags such as
        <code>&lt;img /&gt; </code> and
        <code> &lt; input / &gt;</code> directly introduce content into the page. Other tags such as
        <code>&lt;p></code> surround and provide information about document text and may include other tags as sub-elements. Browsers do not display the HTML tags, but use them to interpret the content of the page.
      </p>
      <p> HTML can embed programs written in a scripting language such as JavaScript, which affects the behavior and content of web pages. Inclusion of CSS defines the look and layout of content. The World Wide Web Consortium (W3C), former maintainer of the
        HTML and current maintainer of the CSS standards, has encouraged the use of CSS over explicit presentational HTML since 1997.[2]
    </article>
  </section>

  <section class=main-section id=Markup>
    <header> Markup</header>
    <article>
      <p> HTML markup consists of several key components, including those called tags (and their attributes), character-based data types, character references and entity references. HTML tags most commonly come in pairs like
        <code>&lt;h1></code> and
        <code>&lt;/h1></code>, although some represent empty elements and so are unpaired, for example <code>&lt;img></code>. The first tag in such a pair is the start tag, and the second is the end tag (they are also called opening tags and closing tags).</p>

      <p>Another important component is the HTML document type declaration, which triggers standards mode rendering.
      </p>
      <p>The following is an example of the classic "Hello, World!" program:
      </p>
      <div class=large-code>
        <code>
           &lt;!DOCTYPE html&gt;
           </br>
  &lt;html&gt;
           </br>
  &lt;head&gt;
          </br>
    &lt;title&gt;</code> <span>This is a title</span> <code>&lt;/title&gt;
      </br>
  &lt;/head&gt;
     </br>
  &lt;body&gt;
  </br>
&lt;p></code> <span>This is a title!</span> <code>&lt;/p&gt;
    </br>
  &lt;/body&gt;
  </br>
  &lt;/html&gt;
        </code>
      </div>
      <br>
      <p>The text between
        <code>&lt;html&gt;</code> and
        <code>&lt;/html&gt;</code> describes the web page, and the text between
        <code>&lt;body&gt;</code> and
        <code>&lt;/body&gt;</code> is the visible page content. The markup text
        <code>&lt;title&gt;</code> This is a title
        <code>&lt;/title&gt;</code> defines the browser page title.
      </p>
      <p>The Document Type Declaration
        <code> &lt;!DOCTYPE html&gt;</code> is for HTML5. If a declaration is not included, various browsers will revert to "quirks mode" for rendering.
      </p>
    </article>
  </section>

  <section class=main-section id=Elements>
    <header>Elements </header>
    <article>
      <p>HTML documents imply a structure of nested HTML elements. These are indicated in the document by HTML tags, enclosed in angle brackets thus: <code>&lt;p&gt;</code>.
      </p>
      <p>In the simple, general case, the extent of an element is indicated by a pair of tags: a "start tag"
        <code>&lt;p&gt;</code> and "end tag"
        <code>&lt;/p&gt;</code> . The text content of the element, if any, is placed between these tags.
      </p>
      <p>Tags may also enclose further tag markup between the start and end, including a mixture of tags and text. This indicates further (nested) elements, as children of the parent element.
      </p>
      <p>The start tag may also include attributes within the tag. These indicate other information, such as identifiers for sections within the document, identifiers used to bind style information to the presentation of the document, and for some tags such
        as the <code>&lt;img&gt;</code> used to embed images, the reference to the image resource.
      </p>
      <p> Some elements, such as the line break <code>&lt;br&gt;</code> , do not permit any embedded content, either text or further tags. These require only a single empty tag (akin to a start tag) and do not use an end tag.
      </p>
      <p> Many tags, particularly the closing end tag for the very commonly used paragraph element
        <code>&lt;p&gt;</code> , are optional. An HTML browser or other agent can infer the closure for the end of an element from the context and the structural rules defined by the HTML standard. These rules are complex and not widely understood by
        most HTML coders.
      </p>
      <p>The general form of an HTML element is therefore:</p>
      <div class=large-code>
        <code>&lt;tag attribute1="value1" attribute2="value2"&gt;</code> <span>''content''</span> <code>&lt;/tag&gt;</code>
      </div>
      <p>Some HTML elements are defined as empty elements and take the form</p>
      <div class=large-code>
      <code>&lt;tag attribute1="value1" attribute2="value2"&gt;</code>.
      </div>
      <p>Empty elements may enclose no content, for instance, the <code>&lt;br&gt;</code> tag or the inline <code>&lt;img&gt;</code> tag. The name of an HTML element is the name used in the tags. Note that the end tag's name is preceded by a slash character,
        /, and that in empty elements the end tag is neither required nor allowed. If attributes are not mentioned, default values are used in each case.
      </p>
    </article>
  </section>

  <section class=main-section id=Elements_examples>
    <header>Elements examples </header>
    <article>
      <p>Header of the HTML document: <code>&lt;head&gt;...&lt;/head&gt;</code>. The title is included in the head, for example:</p>
      <div class=large-code>
        <code>
&lt;head&gt;
          &lt;title&gt;</code> <span>The Title</span> <code>&lt;/title&gt;
&lt;/head&gt;
      </code>
      </div>
      <br>
      <p>Headings: HTML headings are defined with the <code>&lt;h1&gt;</code> to <code>&lt;h6&gt;</code> tags with H1 being the highest (or most important) level and H6 the least:</p>
      <div class=large-code>
<code>
  &lt;h1&gt;</code> <span>Heading level 1</span> <code>&lt;/h1&gt;
          <br>
&lt;h2&gt;</code> <span>Heading level 2</span> <code>&lt;/h2&gt;
          <br>
&lt;h3&gt;</code> <span>Heading level 3</span> <code>&lt;/h3&gt;
          <br>
&lt;h4&gt;</code> <span>Heading level 4</span> <code>&lt;/h4&gt;
          <br>
&lt;h5&gt;</code> <span>Heading level 5</span> <code>&lt;/h5&gt;
          <br>
      &lt;h6&gt;</code> <span>Heading level 6</span> <code>&lt;/h6&gt;
  </code>
      </div>
      <p>Paragraphs:</p>
<div class=large-code>
     <code> &lt;p&gt;</code> <span>Paragraph 1</span> <code>&lt;/p&gt;
       <br>
       &lt;p&gt;</code> <span>Paragraph 2</span> <code>&lt;/p&gt </code>
      <br>
      </div>
      <p> Line breaks: <code>&lt;br&gt;</code>. The difference between <code>&lt;br&gt;</code> and
      <code> &lt;p&gt;</code> is that br breaks a line without altering the semantic structure of the page, whereas p sections the page into paragraphs. Note also that br is an empty element in that, although it may have attributes, it can take no content and it may not have
      an end tag.</p>
<div class=large-code>
      <code> &lt;p&gt;</code> <span>This </span> <code>&lt;br&gt;</code> <span>is a paragraph</span> <code> &lt;br&gt;</code> <span> with </span> <code>&lt;br&gt</code> <span>line breaks</span> <code>&lt;/p&gt; </code>
      </div>
        <p>This is a link in HTML. To create a link the <code>&lt;a&gt;</code> tag is used. The href attribute holds the URL address of the link.</p>
<div class=large-code>
  <code>&lt;a href="https://www.wikipedia.org/"&gt;</code> <span>A link to Wikipedia!</span> <code>&lt;/a&gt;
        </code>
      </div>
      <p>Inputs: </p>
      <p>There are many possible ways a user can give input/s like:</p>
<div class=large-code>
  1  <code>&lt;input type="text" /&gt;</code>
        <code>&lt;!-- This is for text input --&gt;</code> 
<br>
      2  <code>&lt;input type="file" /&gt;</code> 
            <code> &lt;!-- This is for uploading files --&gt;</code> 
<br>
     3 <code>&lt;input type="checkbox" /&gt;</code> 
           <code>&lt;!-- This is for checkboxes --&gt;</code>    
    </div>
        
  <p>Comments:</p>
<div class=large-code>
      <code>&lt;!-- This is a comment --&gt;</code>
      </div>
        <p>Comments can help in the understanding of the markup and do not display in the webpage.</p>
    </article>
  </section>

  <section class=main-section id=Attributes>
    <header> Attributes</header>
    <article>
      <p>Most of the attributes of an element are name-value pairs, separated by <code>=</code> and written within the start tag of an element after the element's name. The value may be enclosed in single or double quotes, although values consisting of certain
        characters can be left unquoted in HTML (but not XHTML). Leaving attribute values unquoted is considered unsafe. In contrast with name-value pair attributes, there are some attributes that affect the element simply by their presence in the start
        tag of the element, like the <code>ismap</code> attribute for the <code>img</code> element.</p>
      <p>There are several common attributes that may appear in many elements :</p>
      <ul>
        <li> The id attribute provides a document-wide unique identifier for an element. This is used to identify the element so that stylesheets can alter its presentational properties, and scripts may alter, animate or delete its contents or presentation. Appended to the URL of the page, it provides a globally unique identifier for the element, typically a sub-section of the page. For example, the ID "Attributes" in <code>https://en.wikipedia.org/wiki/HTML#Attributes</code>.</li>
        <li> The class attribute provides a way of classifying similar elements. This can be used for semantic or presentation purposes. For example, an HTML document might semantically use the designation <code>&lt;class="notation"&gt;</code> to indicate that all elements with this class value are subordinate to the main text of the document. In presentation, such elements might be gathered together and presented as footnotes on a page instead of appearing in the place where they occur in the HTML source. Class attributes are used semantically in microformats. Multiple class values may be specified; for example <code>&lt;class="notation important>&gt;</code> puts the element into both the notation and the important classes. </li>
        <li>An author may use the style attribute to assign presentational properties to a particular element. It is considered better practice to use an element's id or class attributes to select the element from within a stylesheet, though sometimes this
          can be too cumbersome for a simple, specific, or ad hoc styling.</li>
        <li> The title attribute is used to attach subtextual explanation to an element. In most browsers this attribute is displayed as a tooltip. </li>
        <li>The lang attribute identifies the natural language of the element's contents, which may be different from that of the rest of the document. For example, in an English-language document:
          <div class=large-code>
          <code> &lt;p&gt;</code> <span>Oh well, </span> <code>&lt;span lang="fr"&gt;</code> <span>c'est la vie</span> <code>&lt;/span&gt;</code> <span>, as they say in France.</span> <code>&lt;/p&gt; </code> 
          </div>
        </li>
      </ul>
        <p>The abbreviation element, abbr, can be used to demonstrate some of these attributes:</p>
            <div class=large-code>
        <code>&lt;abbr id="anId" class="jargon" style="color:purple;" title="Hypertext Markup Language"&gt;</code> <span>HTML</span> <code>&lt;/abbr&gt;</code>
            </div>
        <p>This example displays as
          <abbr id="jargon" title="Hypertext Markup Language">HTML</abbr> ; in most browsers, pointing the cursor at the abbreviation should display the title text "Hypertext Markup Language."</p>

        <p>Most elements take the language-related attribute dir to specify text direction, such as with "rtl" for right-to-left text in, for example, Arabic, Persian or Hebrew</p>
    </article>
  </section>

  <section class=main-section id=Character_and_entity_references>
    <header> Character and entity references</header>
    <article>
      <p>As of version 4.0, HTML defines a set of 252 character entity references and a set of 1,114,050 numeric character references, both of which allow individual characters to be written via simple markup, rather than literally. A literal character and
        its markup counterpart are considered equivalent and are rendered identically.
      </p>
      <p>The ability to "escape" characters in this way allows for the characters <code>&lt;</code> and <code>&</code> (when written as <code>&</code><code>lt;</code> and <code>&</code><code>amp;</code>, respectively) to be interpreted as character data,
        rather than markup. For example, a literal <code>&lt;</code> normally indicates the start of a tag, and & normally indicates the start of a character entity reference or numeric character reference; writing it as <code>&</code><code>amp;</code>        or <code>&</code><code>#x26;</code> or <code>&</code><code>#38;</code> allows <code>&</code> to be included in the content of an element or in the value of an attribute. The double-quote character <code>(")</code>, when not used to quote an attribute
        value, must also be escaped as <code>&</code><code>quot;</code> or <code>&</code><code>#x22;</code> or <code>&</code><code>#34;</code> when it appears within the attribute value itself. Equivalently, the single-quote character <code>(')</code>,
        when not used to quote an attribute value, must also be escaped as <code>&</code><code>#x27;</code> or <code>&</code><code>#39;</code> (or as <code>&</code><code>apos;</code> in HTML5 or XHTML documents) when it appears within the attribute value
        itself. If document authors overlook the need to escape such characters, some browsers can be very forgiving and try to use context to guess their intent. The result is still invalid markup, which makes the document less accessible to other browsers
        and to other user agents that may try to parse the document for search and indexing purposes for example.
      </p>
      <p>Escaping also allows for characters that are not easily typed, or that are not available in the document's character encoding, to be represented within element and attribute content. For example, the acute-accented <code>e</code> <code>(é)</code>,
        a character typically found only on Western European and South American keyboards, can be written in any HTML document as the entity reference <code>&</code><code>eacute;</code> or as the numeric references <code>&</code><code>#xE9;</code> or
        <code>&</code><code>#233;</code>, using characters that are available on all keyboards and are supported in all character encodings. Unicode character encodings such as UTF-8 are compatible with all modern browsers and allow direct access to almost
        all the characters of the world's writing systems.</p>
    </article>
  </section>

  <section class=main-section id=Data_types>
    <header>Data types </header>
    <article>
      <p>HTML defines several data types for element content, such as script data and stylesheet data, and a plethora of types for attribute values, including IDs, names, URIs, numbers, units of length, languages, media descriptors, colors, character encodings,
        dates and times, and so on. All of these data types are specializations of character data. </p>
    </article>
  </section>

  <section class=main-section id=Document_type_declaration>
    <header>Document type declaration </header>
    <article>
      <p> HTML documents are required to start with a Document Type Declaration (informally, a "doctype"). In browsers, the doctype helps to define the rendering mode—particularly whether to use quirks mode.
      </p>
      <p>The original purpose of the doctype was to enable parsing and validation of HTML documents by SGML tools based on the Document Type Definition (DTD). The DTD to which the DOCTYPE refers contains a machine-readable grammar specifying the permitted
        and prohibited content for a document conforming to such a DTD. Browsers, on the other hand, do not implement HTML as an application of SGML and by consequence do not read the DTD.
      </p>
      <p>HTML5 does not define a DTD; therefore, in HTML5 the doctype declaration is simpler and shorter:
      </p>
      <div class=large-code>
      <code>&lt;!DOCTYPE html&gt;</code>
      </div>
      <p>An example of an HTML 4 doctype</p>
<div class=large-code>
      <code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "https://www.w3.org/TR/html4/strict.dtd"&gt;</code>
      </div>
      <p>This declaration references the DTD for the "strict" version of HTML 4.01. SGML-based validators read the DTD in order to properly parse the document and to perform validation. In modern browsers, a valid doctype activates standards mode as opposed
        to quirks mode.
      </p>
      <p>In addition, HTML 4.01 provides Transitional and Frameset DTDs, as explained below. Transitional type is the most inclusive, incorporating current tags as well as older or "deprecated" tags, with the Strict DTD excluding deprecated tags. Frameset
        has all tags necessary to make frames on a page along with the tags included in transitional type
      </p>
    </article>
  </section>

<section class=main-section id=Reference>
  <header> Reference </header>
  <article>
    <p> All information on this page is taken from <a href=https://en.wikipedia.org/wiki/HTML target=_blank>this Wikipedia link </a>
    </p>
</main>
              
            
!

CSS

              
                html {
  background-color: hsl(0, 0%, 90%);
font-family: sans-serif;
}
p, li {
  line-height: 150%;
}


#navbar {
  position: fixed;
  height: 100%;
  max-width: 300px;
  top: 0px;
  left: 0px;
  background-color: hsl(0, 0%, 94%)
}

#navbar header {
  font-size: 1.7em;
  padding: 20px;
  margin: 15px;
}
#navbar ul {
  list-style: none;
  overflow-y: scroll;
  height: 80%;
}
#navbar li{
  border: 1px solid hsl(0, 0%, 60%);
  padding: 25px;
  font-size: 1.3em;
  margin: 0px 1px 0px -50px;
}

.nav-link {
  color: hsl(0, 0%, 20%);
}




main {
 font-family: Helvetica, Arial, sans-serif;
  position: absolute;
  margin-left: 290px;
  background-color: hsl(0, 0%, 90%);
  border-left: 2px solid hsl(0, 0%, 60%);
}
section header {
  font-size: 2em;
}
  section {
    margin: 10px;
    padding: 5px;
    background-color: hsl(0, 0%, 97%);
    border-radius: 1%
  }
.large-code {
  border: solid 1px grey;
  width: 85%;
  background-color: #ddd;
  margin: auto;
  padding: 5px 1px 5px 5px;
  line-height: 150%
}
code {
  color: #f6eabd;
  background-color: #091542;
  padding: 3px;
line-height: 150%;
   white-space: none;
  border-radius: 4%;
  font-size: 1.2em
}

#jargon {
  color: purple;
}

@media (max-width: 660px) {
  #navbar {
  poition: absolute;
  max-width: 100%;
    width: 100%;
   height: 200px;
  }
  #navbar header {
  font-size: 1.6em;
  padding: 2px;
  margin: 10px 1px 1px 10px
}
#navbar ul {
  list-style: none;
  overflow-y: scroll;
  height: 80%;
 margin: 1px 1px 1px 1px
}
#navbar li{
  border: none;
  border-top: 1px solid hsl(0, 0%, 60%);
  padding: 5px;
  font-size: 1.2em;
  margin: 0px 0px 0px -30px
}
  main {
    margin-left: -10px;
    margin-top: 190px;
    border-left: 0px
  }
  
}
              
            
!

JS

              
                
              
            
!
999px

Console