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

              
                <head>
  <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
  
  <title>CSS Text</title>
  
  <link href="https://fonts.googleapis.com/css?family=Cabin|Roboto:400,700|Roboto+Condensed:400,700" rel="stylesheet">
 </head>

<main id="main-doc">
  
  <nav id="navbar">
    <header>
      <h1>
     CSS Text
      </h1>
    </header>
    
     <ul> 
    <li><a class="nav-link" href="#CSS_Text_Color">CSS Text Color</a></li>  
    <li><a class="nav-link" href="#CSS_Text_Alignment">CSS Text Alignment</a></li>
    <li><a class="nav-link" href="#CSS_Text_Decoration">CSS Text Decoration</a></li>
    <li><a class="nav-link" href="#CSS_Text_Transformation">CSS Text Transformation</a></li>
    <li><a class="nav-link" href="#CSS_Text_Spacing">CSS Text Spacing</a></li>
    <li><a class="nav-link" href="#CSS_Text_Shadow">CSS Text Shadow</a></li>
       <li><a class="nav-link" href="#Reference">Reference</a></li>
       </ul> 
  </nav>
  <div class="sections">
   <section class="main-section" id="CSS_Text_Color">
     <header>
     CSS Text Color
       </header>
     <p>The color property is used to set the color of the text. The color is specified by:</p>
     <ul>
       <li>a color name - like "red"</li>
       <li>a HEX value - like "#ff0000"</li>
       <li>an RGB value - like "rgb(255,0,0)"</li>
     </ul>
     <code>body { color: blue; } h1 { color: green; }</code>
     <p>The default text color for a page is defined in the body selector.</p>
  </section>
  
  <section class="main-section" id="CSS_Text_Alignment">
    <header>
     CSS Text Alignment
      </header>
    <p>The text-align property is used to set the horizontal alignment of a text.</p>
    <p>A text can be left or right aligned, centered, or justified.</p>
    <p>The following example shows center aligned, and left and right aligned text (left alignment is default if text direction is left-to-right, and right alignment is default if text direction is right-to-left):</p>
    <code>h1 { text-align: center; } h2 { text-align: left; } h3 { text-align: right; }</code>
  </section>
  
   <section class="main-section" id="CSS_Text_Decoration">
     <header>
     CSS Text Decoration
       </header>
     <p>The text-decoration property is used to set or remove decorations from text.</p>
     <p>The value text-decoration: none; is often used to remove underlines from links:</p>
     <code>a { text-decoration: none; }</code>
  </section>
  
   <section class="main-section" id="CSS_Text_Transformation">
     <header>
     CSS Text Transformation
       </header>
     <p>The text-transform property is used to specify uppercase and lowercase letters in a text.</p>
     <p>It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word:</p>
     <code>p.uppercase {
  text-transform: uppercase;
}

p.lowercase {
  text-transform: lowercase;
}

p.capitalize {
  text-transform: capitalize;
}</code>
  </section>
  
   <section class="main-section" id="CSS_Text_Spacing">
     <header>
     CSS Text Spacing
       </header>
     <p>Here are five different properties used in text spacing</p>
     <ul>
       <li>Letter Spacing</li>
       <li>Line Height</li>
       <li>Word Spacing</li>
       <li>White Space</li>
       <li>Text Indentation</li>
     </ul>
     <p>The text-indent property is used to specify the indentation of the first line of a text:</p>
     <code>p {
  text-indent: 50px;
}</code>
  </section>
  
  <section class="main-section" id="CSS_Text_Shadow">
    <header>
    CSS Text Shadow
    </header>
    <p>The text-shadow property adds shadow to text.</p>
    <p>In its simplest use, you only specify the horizontal shadow (2px) and the vertical shadow (2px):</p>
    <code>h1 {
  text-shadow: 2px 2px;
}</code>
  </section>
  <section class="main-section" id="Reference">
     <header>
     Reference
       </header>
    <ul>
    <li>All the documentation in this page is taken from <a class="schools" href="https://www.w3schools.com/css/css_text.asp">W3Schools</a>.</li>
    </ul>
  </section>
  </div>
</main>
              
            
!

CSS

              
                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;
  Font-Family: 'Roboto Condensed', Sans-Serif;
  color: #5B949A;
}

h1 {
  padding-left: 2vw;
  font-size: 1.2em;
  color: #5B949A;
}

p {
  Font-Family: 'Cabin', Sans-Serif;
}

#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%;
  Font-Family: 'Cabin', Sans-Serif;
}

#navbar a {
  display: block;
  padding: 10px 30px;
  color: #4d4e53;
  text-decoration: none;
  cursor: pointer;
   -o-transition:.5s;
  -ms-transition:.5s;
  -moz-transition:.5s;
  -webkit-transition:.5s;
}
#navbar a:hover { background-color: #B5CCCE; }

a {
  color: #568287;
  text-decoration: none;
  cursor: pointer;
   -o-transition:.5s;
  -ms-transition:.5s;
  -moz-transition:.5s;
  -webkit-transition:.5s;
}
a:hover {color: #84B3B8 ; }

#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;
  Font-Family: 'Cabin', Sans-Serif;
}

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: 165px;
  }

  #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;
    
  }
.sections {
   margin-top: 55vw;
  }
  h1 {
    text-align: center;
  }
}

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

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

JS

              
                
              
            
!
999px

Console