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>text-justify</code>:</p>

<select id="form">
    <option value="none" name="value2">none</option>
  <option value="auto" name="value2" selected>auto</option>
  <option value="inter-word" name="value2">inter-word</option>
  <option value="inter-character" name="value2">inter-character</option>

</select>

<p id="text"></p>

<hr>

<p id="block">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia ullam vel maxime delectus fuga quod doloribus atque quisquam tenetur fugit esse nulla dignissimos quis vero sit totam aliquam suscipit nam, vitae, eius, ratione ipsam ea exercitationem. Amet, illum. Quibusdam alias neque impedit veniam blanditiis reprehenderit doloremque, ratione odio perspiciatis voluptatum.</p>
              
            
!

CSS

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

body {
  font-family: momospace;
  font-size: 17px;
  line-height: 1.5;
  color: #222;
}


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

#block {
  margin: 75px auto 0 auto;
  background: gold;
  padding: 16px;
  font-size: 18px;
  color: #222;
  text-align: justify;
  text-justify: none;
}

#text {
  height: 50px;
  background-color: #eee;
  padding: 16px 0;
}
              
            
!

JS

              
                var block = document.getElementById('block');
var form = document.getElementById('form');
var text = document.getElementById('text');

  var textArray = { 'none': 'Забороняє методи вирівнювання',
                   'auto': 'Браузер самостійно визначає алгоритм вирівнювання.',
                    'inter-word': 'Буде змінюватися інтервал між словами.',
                   'inter-character': 'Збільшує / зменшує пробіл між символами'};

form.onchange = function change() {
  
  var newVal = getNewValue();  
  block.style.textJustify = newVal;
  text.innerHTML = textArray[newVal];
  
}

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

Console