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 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 id="page-wrapper">
  <nav id="navbar">
    <header>
     How to change colors
    </header>
    <ul class="list-style">
      <li><a class="nav-link" href="#introduction"> Introduction</a></li>
      <li><a class="nav-link" href="#blue"> Blue</a></li>
      <li><a class="nav-link" href="#green"> Green</a></li>
      <li><a class="nav-link" href="#yellow"> Yellow</a></li>
      <li><a class="nav-link" href="#orange"> Orange</a></li>
      <li><a class="nav-link" href="#red"> Red</a></li>
    </ul>

  </nav>

  <main id="main-doc">
    <section id="introduction" class="main-section">
      <header>Introduction</header>
      <article>
        <p> This is a page to learn how to set a text or a background to one of te colors you see here on the right.</p>
        <p>To do this you have to use the color property in css. </p>
        <p><code> p {
        color: black;
        } </code> </p>
        <p> Now you have set the color of the text from the p element to black.
      </article>
    </section>

    <section id="blue" class="main-section">
      <header>Blue</header>
      <p>Here you can see and learn how to make somthing the color blue.</p>
      <p> You can change the color of the text, but you can also change other elements colors. Like....</p>
      <ul>
        <li> - The background </li>
        <li> - The pages background </li>
        <li> - An elements background </li>
        <li> - The texts color (ofcourse) </li>
         <li> - Just anything you like </li>
      </ul>
      <p>So to make the background of an p element blue you use... </p>
      <p><code>p {background-color: blue;}</code></p>
    </section>

    <section id="green" class="main-section">
      <header> Green </header>
      <p> To set something to the color green you can use hex code to make it green</p>
      <p> Set color to green using hex code</p> 
      <p> <code> p {color: #008000 }</code><p>
        <p> Hex code always starts with a hashtag and then has 6 numbers </p>
    </section>

    <section  id="yellow" class="main-section">
      <header> Yellow</header>
      <p> Other than hex code there also is Decimal code RGB</p>
      <p> Set color to yellow using RGB</p>
      <p><code> p {color: rgb(255,255,0)}</code></p>
      <p> RGB always has three diffrent number wich are between 0 and 255</p>
    </section>
    
    <section id="orange" class="main-section"> 
      <header>Orange</header>
      <p> You can set a background to the color orange using...
      </p>
      <p> <code> div {background: #FFA500}</code><p>
        <p> Now the div's background is set to the color orange</p>
    </section>
    
    <section id="red" class="main-section">
      <header> Red</header>
      <p> Set color of a header element to red</p>
      <p><code> header { color: red }</code></p>
      <p> Now the color of the header set to red</p>
    </section>
    </div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz&display=swap");
@import url('https://fonts.googleapis.com/css?family=Gayathri&display=swap');
.list-style {
  list-style: none;
  text-decoration: initial;
  padding: 0;
  margin-left: 10px;
  font-family: "Yanone Kaffeesatz", sans-serif;
  font-size: 40px;
  margin-top: 20px;
}

#navbar {
  width: 190px;
  position: fixed;
  border-right: 4px solid #4fbd69;
display: block;
  
}
.nav-link {
  text-decoration: none;
  color: #a5bf95;
  margin-bottom: 40px
}
header {
  padding-top: 0;
  margin-right: 10px;
}

nav header{
  font-size: 40px;
  font-family: "Yanone Kaffeesatz", sans-serif;
  text-align: center;
  font-style: strong;
}

section{

  padding-left: 210px;
  
}

section header{
  font-size: 40px;
   font-family: "Yanone Kaffeesatz", sans-serif;
  margin-top: 30px;
}
section p{
  font-size: 18px;
   font-family: "Yanone Kaffeesatz", sans-serif;
  color: #4e524f;
}
section code{
  background-color: #edd368;
  padding: 10px;
   
}
section li{
list-style: none;
 font-family: 'Gayathri', sans-serif;
 
}
page-wrapper{
  
}
              
            
!

JS

              
                
              
            
!
999px

Console