Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <body>
  
<p>Soy un párrafo que tengo font-size:1em, por lo tanto, el tamaño de mi fuente es igual al de mi padre, en este caso el body: 20px </p>

<div>
  <p>Soy un párrafo que está dentro de un div tengo font-size:1em, por lo tanto, el tamaño de mi fuente es igual al de mi padre, en este caso el div: 25px </p>
</div>

<p class="ejemplo">Soy un párrafo de la clase ejemplo con font-size:1rem, da igual que esté dentro o fuera de un div, al ser 1rem mi tamaño será el tamaño predeterminado para el elemento raiz, en este caso 16px</p>

<p class="ejemplo2">Soy un párrafo de la clase ejemplo2 con font-size:30px, da igual que esté dentro o fuera de un div, tengo un tamaño fijo de 30px</p>
  
</body>





              
            
!

CSS

              
                body{
  font-size:20px;
}

div{
  font-size:25px;
}

p {
  font-size:1em;
}

div p {
  font-size:1em;
}

p.ejemplo {
  font-size:1rem;
}

p.ejemplo2 {
  font-size:30px;
}

              
            
!

JS

              
                
              
            
!
999px

Console