cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

              <div class="wrap">
  <p>Below you can interact with 4 <code>span</code> elements. Spans are by default inline-level elements.</p>
  <p> Each button toggles styles on every span.</p>

  <p>Toggle the buttons to see how the different display properties behave with other vertical and horizontal CSS properties.</p>
  <br />

  <div class="row">
    <div class="column small-6 medium-4">
      <button class="button expanded secondary js-toggle-prop" data-prop="outline" data-value="1px solid skyblue">toggle visible layout</button>
      <button class="button expanded secondary js-toggle-prop" data-prop="display" data-value="inline">display: inline;</button>

      <button class="button expanded secondary js-toggle-prop" data-prop="display" data-value="block">display: block;</button>

      <button class="button expanded secondary js-toggle-prop" data-prop="display" data-value="inline-block">display: inline-block;</button>

      <hr />

      <button class="button expanded secondary js-toggle-prop" data-prop="width" data-value="100%">toggle 100% width</button>

      <button class="button expanded secondary js-toggle-prop" data-prop="padding" data-value="10px 0">toggle vertical padding</button>


    <div class="column small-6 medium-8">
      <span class="target js-target">Four.</span>
      <span class="target js-target">Adjacent.</span>
      <span class="target js-target">Spans.</span>
      <span class="target js-target">This span contains a far longer piece of text than the prevous three spans.</span>
              .wrap {
  margin-left: auto;
  margin-right: auto;
  max-width: 780px;

.button.secondary {
  &.is-active {
    background-color: skyblue;
              const toggleTargets = document.querySelectorAll('.js-target');
const propTogglers = document.querySelectorAll('.js-toggle-prop');

function propToggler({ toggleElems, targetElems }) {
  const targets = [].slice.call(targetElems);
  const togglers = [].slice.call(toggleElems);
  const activeClassName = 'is-active';

  function init() {
    togglers.map(toggle => {
      toggle.prop = toggle.getAttribute('data-prop');
      toggle.value = toggle.getAttribute('data-value');
      toggle.isActive = false;
    document.body.addEventListener('mouseup', handleClick);
  function handleClick(e) {
    const target = e.target;
    togglers.map(toggle => {
      if (target === toggle) handleToggleClick(toggle);
  function handleToggleClick(toggle) {
    const isActive = toggle.isActive;
    const prop = toggle.prop;
    const value = !toggle.isActive ? toggle.value : '';
    targets.map((el) => el.style[prop] = value );
    toggle.isActive = !isActive;
    if (toggle.isActive) addActiveClass(toggle);
  function deactivateAllByProp(prop) {
    togglers.map(toggle => {
      if (toggle.prop === prop) {
        toggle.isActive = false;
  function addActiveClass(toggle) {
  function removeActiveClass(toggle) {

  toggleElems: propTogglers,
  targetElems: toggleTargets,
Loading ..................