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="container">
  <div class="texte">
    <h1 class="desaxe" id="h1">Pas aligné...</h1>
    <p>Meowing non stop for food poop on grasses. Attack feet meow loudly just to annoy owners step on your keyboard while you're gaming and then turn in a circle.</p>
  </div>
  <div class="texte desaxe">
    <p>Meowing non stop for food poop on grasses. Attack feet meow loudly just to annoy owners step on your keyboard while you're gaming and then turn in a circle . Swat at dog pooping rainbow while flying in a toasted bread costume in space chase ball of
      string friends are not food and cats making all the muffin.</p>
  </div>
  <div class="texte">
    <p>Meowing non stop for food poop on grasses. Attack feet meow loudly just to annoy owners.</p>
  </div>
</div>
<div class="btn-container">
  <button id="trigger_aligne">Aligné</button>
  <button id="trigger_desaxe">Non aligné</button>
</div>
            
          
!
            
              body {
  background: #eee;
}
.container {
  padding: 4em 20%;
}

h1 {
  font-size: 2em;
  margin-bottom: 1.4em;
}

.btn-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 35%;
  margin: 0 auto;
}

button {
  width: 150px;
  line-height: 3;
  color: #fff;
  border: none;
  text-transform: uppercase;
  
  &:focus {
    outline: none;
    box-shadow: 0 8px 8px -8px #777;
  }
}

#trigger_aligne {
  background: #5bb75b;
  
}

#trigger_desaxe {
  background: #da4f49;
}
.text-align {
  margin-left: 3em;
}

.texte {
  margin-bottom: 2em;
  transition: all .3s ease-out;
}

.desaxe {
  margin-left: 3em;
}

.align {
  margin-left: 0;
}
            
          
!
            
              $(document).ready(function() {
  'use strict';
  var $AligneBtn = $('#trigger_aligne');
  var $DesaxeBtn = $('#trigger_desaxe');
  var $texteAligne = $('.desaxe');
  var $h1 = $('#h1');

  $AligneBtn.on('click', function() {
    $texteAligne.addClass('align');
    $h1.text("Aligné !");
  });
  
  $DesaxeBtn.on('click', function() {
    $texteAligne.removeClass('align');
    $h1.text("Pas aligné...");
  });

});
            
          
!
999px
Loading ..................

Console