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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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>

<!-- 

Hello Camper!

For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding! 

- The freeCodeCamp Team 

-->
<main id="main-doc">
    <nav id="navbar">
        <header>Responsive Web Design</header>
        <ul>
            <a class="nav-link" href="#Introduction_CSS_FlexBox"><li>Introduction CSS FlexBox</li></a>
            <a class="nav-link" href="#FlexBox_container_properties"><li>FlexBox container properties</li></a>
            <a class="nav-link" href="#FlexBox_child_properties"><li>FlexBox child properties</li></a>
            <a href="#Introduction_CSS_Grid" class="nav-link"><li>Introduction CSS Grid</li></a>
            <a class="nav-link" href="#Grid_container_properties"><li>Grid container properties</li></a>
            <a class="nav-link" href="#Grid_child_properties"><li>Grid child properties</li></a>
        </ul>      
    </nav>
    <div id="documentatio">
    <section class="main-section" id="Introduction_CSS_FlexBox">
        <header>Introduction CSS FlexBox</header>
        <p>
        CSS3 introduced Flexible Boxes, or flexbox, to create page layouts for a dynamic UI. It is a layout mode that arranges elements in a predictable way for different screen sizes and browsers.
        </p>
    </section>

    <section class="main-section" id="FlexBox_container_properties">
        <header>FlexBox container properties</header>  
        <p>Placing the CSS property <code>display: flex;</code> on an element allows you to use other flex properties to build a responsive page.   
        </p>
        <p>Adding a flex to an element turns it into a flex container. This makes it possible to align any children of that element into rows or columns. You do this by adding the <code>flex-direction:</code> property to the parent item and setting it to row or column. Creating a row will align the children horizontally, and creating a column will align the children vertically.
        </p>
        <p>Values for this property are:</p>
        <ul>
            <li>row</li>
            <li>column</li>
            <li>row-reverse</li>
            <li>column-reverse</li>
        </ul>
        <p>Sometimes the flex items within a flex container do not fill all the space in the container. It is common to want to tell CSS how to align and justify out the flex items a certain way. Fortunately, the <code>justify-content</code> and <code>align-items</code> propertes has several options to do this. 
        </p>
        <p>Values for this properties are as follows:</p>
        <ul>
            <li>center | flex-start | flex-end | space-between | space-around</li>
            <li>center | flex-start | flex-end | baseline</li>
        </ul>
            <p>Using the <code>flex-wrap</code> property, it tells CSS to wrap items.  
            </p>
            <p>Values for this properties are as follows: nowrap| wrap| wrap-reverse
            </p>
    </section>

    <section class="main-section" id="FlexBox_child_properties">
        <header>FlexBox child properties</header> 
        <p>The <code>flex-shrink</code> property. When it's used, it allows an item to shrink if the flex container is too small. The opposite is <code>flex-grow</code> property. The <code>flex-basis</code> property specifies the initial size of the item before CSS makes adjustments with shrinkor and grow. There is a shortcut available to set several flex properties at once. The <code>flex-grow, flex-shrink, and flex-basis</code> properties can all be set together by using the flex property. For example, <code>flex: 1 0 10px;</code> will set the item to <code>flex-grow: 1;</code> , <code>flex-shrink: 0;</code>, and <code>flex-basis: 10px;</code>. The <code>order:</code> property is used to tell CSS the order of how flex items appear in the flex container. By default, items will appear in the same order they come in the source HTML. The property takes numbers as values, and negative numbers can be used. The final property for flex items is <code>align-self</code>. This property allows you to adjust each item's alignment individually, instead of setting them all at once. The <code>align-self</code> accepts the same values as <code>align-items</code> and will override any value set by the <code>align-items</code> property.
        </p>
    </section>

    <section class="main-section" id="Introduction_CSS_Grid">
        <header>Introduction CSS Grid</header>
        <p>CSS Grid helps you easily build complex web designs. It works by turning an HTML element into a grid container with rows and columns for you to place children elements where you want within the grid.
        </p>
    </section>

    <section class="main-section" id="Grid_container_properties">
        <header>Grid container properties</header>
        <p>Turn any HTML element into a grid container by setting its display property to  grid <code>display: grid;</code>. This gives you the ability to use all the other properties associated with CSS Grid.
        </p>
        <p>To add some columns to the grid, use the <code>grid-template-columns</code> property on a grid container as demonstrated below:
            <code>
            .container {
                display: grid;
                grid-template-columns: 50px 50px;
            }
            </code>
            This will give your grid two columns that are 50px wide each. The number of parameters given to the grid-template-columnsproperty indicates the number of columns in the grid, and the value of each parameter indicates the width of each column.      
        </p>
        <p>The grid you created will set the number of rows automatically. To adjust the rows manually, use the <code>grid-template-rows</code> property in the same way you used  <code>grid-template-column</code>.  
        </p>
        <p>Sometimes you want a gap in between the columns and rows. To add a gap between the columns, use the <code>grid-column-gap</code>. To add a gap between the rows, use the <code> grid-row-gap</code>. Shorthand property for <code>grid-row-gap</code> and <code>grid-column-gap</code> is <code>grid-gap</code>. If <code>grid-gap</code> has one value, it will a create a gap between all rows and columns. However, if there are two values, it will use the first one to set the gap between the rows and the second value for the columns.
        </p>
        <p>To align and justify items in css grid use properties <code>align-items:</code> and <code>justify-items</code>. Thise properties may have values: start | center| end.  
        </p>
    </section>

    <section class="main-section" id="Grid_child_properties">
        <header>Grid child properties</header>      
        <p>To place child element within a CSS grid, use <code>grid-column:</code> property, and <code>grid-row:</code>property. 
        </p>
        <p>For example:
            <code>
                grid-column: 1/5;
                grid-row: 1/5;
            </code>
            will place an item in first 5 columns and first 5 rows.
        </p>
        <p>The other properties for grid items is <code>align-self</code>. This property allows you to adjust each item's alignment individually, instead of setting them all at once. The<code> justfy-self</code> allows you to adjust item's justfication individually. The <code>justfy-self</code> and <code>align-self</code> accepts the same values start| center| end.
        </p>
    </section>
    </div><!--end of documentatin-->    
    </main>
              
            
!

CSS

              
                html,body{
    min-width:290px;
      color: #4d4e53;
      background-color: #ffffff;
      font-family: 'Open Sans',Arial,sans-serif;
      line-height: 1.5;
  }
  code {
      color: red;
  }
  ul {
      padding: 0;
  }
  li {
      list-style: none;
  }
  a {
      text-decoration: none;
  }
  /*fixed navbar*/
  #navbar{
      position: fixed;
      top: 0px;
      left: 0px;
      width: 300px;
      height: 100%;
      border-right: 3px solid grey;
  }
  header {
      padding: 15px;
      font-size: 20px;
      color: black;
  }

  #navbar ul a li {
      border-top: 1px solid grey;
      color: grey;
      padding: 15px;
  }

  /*documentatio*/
  #documentatio {
      margin-left: 310px;
      padding: 20px;
      margin-bottom: 110px;
  }
  section {
      text-align: justify;
  }

  /*smaller media */
  @media (max-width: 600px){
    #navbar{
    position: fixed;
    top: 0px;
    width: 100%;
    max-height: 150px;
    border-bottom: 3px solid grey;
    overflow-y: auto;
    background-color:  #ffffff;
    }
    #documentatio {
        margin-top: 150px;
        margin-left: auto;
    }
  }
              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console