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> 
  <head>
    <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
    <title>Technical Documentation Page</title>
    <main id="main-doc">
      <section id="css_introduction" class="main-section">
<header>
  <h2>CSS Introduction</h2>
</header>
        <p>CSS is a style sheet language. The language is used for describing the presentation of a document written in HTML, or other such markup languages such as XHTML, plain XML, SVG, and XUL. Together with HTML and JavaScript, CSS is an important part of the World Wide Web. One of the main features of CSS is that it allows the user to separate the presentation and content of a page, such as fonts, colors, layout. Thanks to the separation, the user's accesability, control, and flexibility are increased.</p>
    <p>Another benefit of using CSS is the fact that a single page can be presented in various styles for different methods: on Braille-based tactile devices, by voice, in print, or on-screen. CSS can also be used to easily format the page in a style suitable for mobile devices.</p>
        <ul>
          <h3>CSS Trivia</h3>
          <li class="lineclass">CSS stands for <strong>Cascading Style Sheets</strong>.</li>
          <li class="lineclass">CSS's filename extension is <code>.css</code>.</li>
          <li class="lineclass">CSS's internet media type is <code>text/css</code>.</li>
          <li class="lineclass">Since CSS can control the layout of multiple web pages at once, it saves a lot of work.</li>
        </ul>
        </section>
      <section id="css_syntax" class="main-section">
        <header>
          <h2>CSS Syntax</h2>
</header>
        <p>A CSS style rules are interpreted by the browser and then applied to the corresponding elements in your document. A rule-set is made out of a selector and a declaration block. The declaration can be further broken-down into a property and a value, so the three elements are: selector, property, and value.</p>
        <img src="https://www.tutorialspoint.com/css/images/syntax.png"</img>
        <p>The selector refers to the HTML element you want to style. Any HTML tag such as head, paragraph, etc. The property is a type of attribute of the HTML tag. It can represent the color, the border, the font-family, etc. Finally, the value is assigned to the property. Color can have a value of red, blue, and so on; the font-family can be arial, times new roman, and so on. The CSS style rule syntax can be written as <code style="background-color:#DCDCDC">selector { property: value }</code>.</p>
        </section>
      <section id="css_selectors" class="main-section">
        <header>
<h2>CSS Selectors</h2>
</header>
        <!-- Trebuie sa ma gandesc daca sa las asa, sau sa mentionez astea din lista si apoi sa fac o lista pt astea simple: Element, id, class -->
        <p>Perhaps the biggest key to understanding CSS is understanding selectors. As previously mentioned, CSS selectors are used to select or find the HTML element you want to style. There are 5 types of CSS selectors: Simple, Combinator, Pseudo-class, Pseudo-elements, and Attribute. We will focus on the simple selectors, which can be further divided into:
        <ul> 
          <li class="lineclass">CSS Element selector</li>
          <li class="lineclass">CSS ID selector</li>
          <li class="lineclass">CSS Class selector</li>
          <li class="lineclass">CSS Universal selector</li>
          </ul></p>
      <p id="simple_selectors"><strong>The element selector</strong> allows you to select HTML elements based on their element name. For example: <code style="background-color:#DCDCDC">p {text-align: center;}</code>. In this case, all paragraph elements will be center-aligned.<br>
        <strong>The id selector</strong> used the id attribute of an HTML element. The id of an element is unique, so thanks to it we can select one unique element. We set the id to an element, and then we choose that id by adding (#) before the given name. For example if a h1 was set with the id of "first_header", then the code will look like: <code style="background-color:#DCDCDC">#first_header {color: red;}</code>. In this case, the header with the id first_header will change its color to red. ID selectors are the most powerful type of selector in terms of CSS specificity.<br>
        <strong>The class selector</strong> is similar to the id one, but the maine difference is that we can add the same class to numberous elements, whereas we can add an id to a single element. In case we want to make the same change to various elements, it is more practical to assign the same class, than to assign numerous ids. We set the class to an element, and then we choose that id by adding (.) before the given name. They are possibly the most useful and versatile selectors out there, as they are supported in all browsers, and they can easily be manipulated through JavaScript.<br>
        <strong>The universal selector</strong> (*) selects all HTML elements on the page. An asterisk can also be followed by a selector. This is useful when you want to set a style for of all the elements of an HTML page or for all of the elements within an element of an HTML page.
      </p>
        </section>
      <section id="how_to_add_css" class="main-section">
        <header>
<h2>How to add CSS</h2>
</header>
        <p>The CSS can be added in three different manners:
          <ul>
            <li class="lineclass">Inline CSS - You add the style attribute to the relevant element</li>
            <li class="lineclass">Internal CSS - The internal style is defined inside the <em>style</em> element, inside the head section.</li>
            <li class="lineclass">External CSS - An external style sheet can be written in any text editor, and must be saved with a .css extension. The HTML page must refer to it in the <em>link</em> element.</li>
        </ul>
        </p>
        
        </section>
      <section id="css_flexbox" class="main-section">
        <!-- Not sure about the last one. Will need to do more research-->
        <header>
<h2>CSS Flexbox</h2>
</header>
        <p>The Flexible Box Module, usually referred to as flexbox, was designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities</p>
        <p>When we describe flexbox as being one dimensional we are describing the fact that flexbox deals with layout in one dimension at a time — either as a row or as a column. This can be contrasted with the two-dimensional model of CSS Grid Layout, which controls columns and rows together. The main idea behind the flex layout is to give the container the ability to alter its items' width/height (and order) to best fill the available space (mostly to accommodate to all kind of display devices and screen sizes). A flex container expands items to fill available free space or shrinks them to prevent overflow.</p>
        </section>
    </main>
  </head>
  
  <!-- Sa vad cum sa fac cu borders, sa incerc sa imi dau seama de cum ar arata mai ok. Sa modific in navli, si sa incerc sa scot bullet points. Also, sa vad cu impartirea in pagina, culoarea, etc-->
  
<nav id="navbar">
<header id="navinfo">CSS Information</header>
  <ul id="navul">
    <li class="navli"><a class="nav-link" href="#css_introduction">CSS Introduction</a></li>
<li class="navli"><a class="nav-link" href="#css_syntax">CSS Syntax</a></li>
<li class="navli"><a class="nav-link" href="#css_selectors">CSS Selectors</a></li>
<li><a class="nav-link" href="#how_to_add_css">How to add CSS</a></li>
<li><a class="nav-link" href="#css_flexbox">CSS Flexbox</a></li>
  </ul>
  </nav>
</html>
              
            
!

CSS

              
                #main-doc {
  position: absolute;
  right: 0;
  bottom: 20;
  padding-left: 270px;
  margin-left: 300px;
  padding:20px;
}

#simple_selectors {
  line-height: 25px;
  }

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  min-width: 290px;
  height: 38%;
  background-color: #F5F5F5;
  border: solid;
  border-style: hidden;
  }

#navul {
  list-style: none;
  line-height: 50px;
  font-size: 20px;
  text-align: left;
  margin: 0 auto;
  }

#navinfo {
  margin-top: 20px;
  font-weight: bold;
  text-align: center;
  font-size: 28px;
  padding-bottom: 15px;
  margin-left: -13px;
  }

a {
  text-decoration: none;
  font-size: 20px;
  font-family: times new roman, arial;
  text-align: center;
  }

/* unvisited link */
a:link {
  color: black;
}

/* visited link */
a:visited {
  color: black;
}

p {
  font-family: times new roman;
  line-height: 25px;
  }

.lineclass {
  line-height: 25px;
}

@media screen and (max-width: 600px) {
  #main-doc {
  width: 80%;
  padding-top: 380px;
  }
  
  img {
    width: 100%;
  }
  
  #navbar {
  position: absolute;
    top: 0;
    padding-bottom: 200px;
    margin-bottom: 200px;
    width: 70%;
    max-height: 200px;
    margin-left: 50px;
    }  
  
  #navul {
  width: 100%;
  font-size: 5px;
  }
  
  #navli {
    font-size: 3px;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console