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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

              <ul class="tab">
  <li><a href="">onglet 1</a></li>
  <li><a href="">onglet 2</a></li>
  <li><a href="">onglet 3</a></li>
<div class="content">
  <p>Contenu 1 : Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero quasi, eius sequi molestias. Quod facilis eaque ut eum, quas ratione, corporis natus quibusdam. Necessitatibus perferendis, amet quidem suscipit, eos voluptatum.</p>
<div class="content">
  <p>Contenu 2 : Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ullam repellat veritatis harum reiciendis eos natus quo vero alias quae delectus praesentium, voluptate exercitationem ut nobis nulla quibusdam, et labore quia!</p>
<div class="content">
  <p>Contenu 3 : Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod, fugiat. Aliquam adipisci inventore officia, doloribus placeat accusantium velit, cumque nemo distinctio aspernatur quam possimus aliquid sint molestias, ipsum esse quia!</p>
  margin: 10px;
  overflow: hidden;
  background-color: rgb(100,100,100);
  margin: 5px;
.tab a{
  text-decoration: none;
  display: block;
  float: left;
  padding: 10px;
  transition : all 0.5s ease;
  color: white;
.tab .active{
  background-color: rgb(200,200,200);
  color: #000;
  display: none;
  animation : fade 1s;

@keyframes fade {
  0% {opacity: 0;}
  100% {opacity: 1;}
  function $(selecteur){
    return document.querySelectorAll(selecteur);
  var onglets = $('.tab a');
  var contenus = $('.content'); 
  function reset(obj,i){
    obj.style.display = "none";
  function tab(evt){
    evt.preventDefault(); // annule l'action du lien'
    contenus[this.rang].style.display = "block";
  var init = function(obj,i){
    obj.rang = i ;

  contenus[0].style.display = "block";
Loading ..................