Pen Settings



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


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


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.


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.


  <p>The following section is 50% the width of its parent's width.</p>
  <section class="example fill-half solid"></section>
  <p>But you probably already knew how <a target="_blank" href="">percentages</a> work on elements.</p>
  <p>Percentages are relative to whichever property they are used on.</p>
  <p>Where things get interesting is when you use a percentage to set a font's size.</p>
  <section class="example large-text">
    <p class="percentage">This paragraph is 50% the size of the parent's <a target="_blank" href="">font-size</a>.</p>
    <p>The parent's font-size is 3em.</p>
  <p>When a font's size is set to a percentage, its size is dependent on its parent's font size.</p>
  <p>So in the following example, the first paragraph's font size is 0.5em.</p>
  <section class="example small-text">
    <p class="percentage">This paragraph is also 50% the size of the parent's <a target="_blank" href="">font-size</a>.</p>
    <p>But the parent's font-size is 1em.</p>
  <p>That makes logical sense.</p>
  <footer class="important">
    <a target="_blank" href="">!important</a>


                .fill-half {
  width: 50%;

.percentage {
  font-size: 50%;

.large-text {
  font-size: 3em;

.small-text {
  font-size: 1em;

.solid {
  background-color: #ffe8ec;

.example {
  margin: 0.5rem auto;
  padding: 0.5rem;
  border: 2px solid #ffe8ec;
  border-radius: 5px;
  text-align: center;

.example p {
  margin-top: 0;
  margin-bottom: 0;

.example p:last-of-type {
  margin-top: 0.5rem;

p {
  font-size: 1.1rem;
  font-weight: 500;
  color: #f7f7f7;

a {
  font-weight: 900;
  color: #ffe3b0;
  text-decoration-style: dashed;

a:hover {
  text-decoration-style: solid;

main {
  max-width: 27rem;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 5px;
  color: white;
  background-color: #ea8071;

body {
  padding: 0;
  margin: 0;
  background-color: #e7e7e7;
  font-family: Verdana, Geneva, sans-serif;

.important {
  display: block;
  color: #ffc5bc;
  text-align: center;
  transition: all 0.2s ease-in-out;

.important:hover {
  animation-name: wiggle;
  animation-duration: 0.5s;
  animation-timing-function: ease-in-out;  
  padding: 10px;
  box-shadow: 0 0 4px 1px #d05b4a;
  background-color: #ee897a;
  color: #000;
  text-decoration: none;
  font-size: 1.2rem;

@keyframes wiggle {
  0% {
    transform: rotate(0turn);

  25% {
    transform: rotate(0.01turn);

  50% {
    transform: rotate(-0.01turn);

  100% {
    transform: rotate(0turn);