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

              
                <p>Вибери потрібне значення для <code>font</code>. У цьому прикладі, Ви можете змінювати такі властивості як <em>font-style</em>, <em>font-variant</em>, <em>font-weight</em>, <em>font-size</em>, <em>font-family</em> (у цій же послідовності).</p>

<select id="style" onchange="update()">
  <option value="normal">normal</option>
  <option value="italic" selected>italic</option>
  <option value="oblique">oblique</option>
</select>
<select id="variant" onchange="update()">
  <option value="normal">normal</option>
  <option value="small-caps" selected>small-caps</option>
</select>
<select id="weight" onchange="update()">
  <option value="normal" selected>normal</option>
  <option value="bold">bold</option>
  <option value="100">100</option>
  <option value="200">200</option>
  <option value="300">300</option>
  <option value="400">400</option>
  <option value="500">500</option>
  <option value="600">600</option>
  <option value="700">700</option>
  <option value="800">800</option>
  <option value="900">900</option>
</select>
<input type="number" value="20" id="size" placeholder="font-size" onchange="update()" min="0">/
<input type="number" value="1.4" step="0.1" id="height" placeholder="line-height" onchange="update()" min="0">
<input type="text" value="sans-serif" id="family" placeholder="font-family" onchange="update()">

<hr>

<div id="block">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur.</p>
</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
  padding: 0;
}

body {
  color: #222;
}

#form {
  padding: 8px 16px;
  font-size: 19px;
}

#block {
  background: #f1f1f1;
  padding: 10px;
  font: italic small-caps normal 20px/1.4 sans-serif;
}
              
            
!

JS

              
                var style = document.getElementById('style');
var block = document.getElementById('block');
var variant = document.getElementById('variant');
var weight = document.getElementById('weight');
var size = document.getElementById('size');
var height = document.getElementById('height');
var family = document.getElementById('family');

function update() {
  block.style.fontStyle = getVal(style);
  block.style.fontVariant = getVal(variant);
  block.style.fontWeight = getVal(weight);
  block.style.fontSize = size.value + 'px';
  block.style.lineHeight = height.value;
  block.style.fontFamily = family.value;
}

function getVal(el) {
  var result = '';
  for (var i = 0; i < el.options.length; i++) {
    if (el.options[i].selected == true) {
      result = el.options[i].value;
    }
  }
  return result;
}
              
            
!
999px

Console