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.

            
              <div data-html="[button class='lang' lang='en' data-lang-en='Voir en français']See in english[/button]"></div>
<div class="main" lang="fr">
<div class="intro">
  <h1 data-lang-en="[abbr]HTML[/abbr] semantics">Sémantique <abbr>HTML</abbr></h1>
  <p><em data-lang-en="Get a better understanding of how machines see your code by disabling [abbr]CSS[/abbr]. [button]Disable stylesheets[/button]">On peut simuler la perception de la page par les machines quand <abbr>CSS</abbr> est désactivé. <button>Désactiver le <abbr>CSS</abbr></button></em></p>
</div>
<div class="bloc css">
  <h2 data-lang-en="With a semantic layer">Avec une couche sémantique</h2>
  <div class="content" lang="la">
    <h3>Donec et mollis dolor</h3>
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.
    </p>
    <ul>
      <li><a href="#">Nam</a></li>
      <li><a href="#">Tincidunt</li>
      <li><a href="#">Congue</a></li>
    </ul>
    <h3>Donec et mollis dolor</h3>
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.
    </p>
    <p>
      Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.
    </p>
  </div>
</div><!--
--><div class="bloc css">
  <h2 data-lang-en="Without a semantic layer">Sans couche sémantique</h2>
  <div class="content" lang="la">
    <div class="h3">Donec et mollis dolor</div>
    <div class="p">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.
    </div>
    <div class="ul">
      <div><a href="#">Nam</a></div>
      <div><a href="#">Tincidunt</a></div>
      <div><a href="#">Congue</a></div>
    </div>
    <div class="h3">Donec et mollis dolor</div>
    <div class="p">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.
    </div>
    <div class="p">
      Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.
    </div>
  </div>
</div>
<div class="outro">
  <p><a href="https://codepen.io/collection/JLacg/" data-lang-en="All other technical demonstrations of front-end concepts">Toutes les autres démonstrations techniques des concepts <i lang="en">front-end</i>.</a></p>
</div>
</div>
            
          
!
            
              @import "compass/css3";

@import 'compass';

html
{
  background-color: #fdfaf8;
  font-family: "Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif;
}
body
{
  margin: 1em;
  text-align: center;
}
.bloc
{
  width: 500px;
  border: 1px solid #e7e4e2;
  margin:  1em;
  padding: 2em 2em 1em;
  display: inline-block;
  vertical-align: top;
  text-align: left;
  background-color: white;
  position: relative;
}
h1,
h2
{
  
  margin-top: 0;
}
img
{
  margin: auto;
  display: block;
}
.intro
{
  max-width: 600px;
  margin: auto;
  font-size: 1.5em;
  padding: 4em 0;
  
  em
  {
    font-style: normal;
  }
  button
  {
    display: block;
    margin: 2em auto 0;
    border: 0;
    padding: 1em;
    background-color: #5B537E;
    color: #fff;
    line-height: 1.25;
    font-size: 0.85em;
    transition: background-color 300ms;
    
    &:hover,
    &:focus
    {
      background-color: #706a99;
    }
  }
}
.outro
{
  max-width: 600px;
  margin: auto;
  font-size: 1.5em;
  padding: 2em 0 3em;
  font-weight: bold;
  a
  {
    display: block;
  }
}
a
{
  color: #5B537E;
  transition: color 300ms;
  
  &:hover,
  &:focus,
  &:visited
  {
    color: #706a99;
  }
}
.content
{
  font-family: serif;
  
  a
  {
    color: blue;
  }
}
.css
{
  .content
  {
    font-family: "Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif;
    
    a
    {
      color: #5B537E;
    }
  }
  
	ul,
  .ul
  {
    @include clearfix;
    padding: 0;
    margin: 0 0 1em;

    & > *
    {
      float: left;
      list-style-type: none;
      margin-right: 2em;
    }
  }
  p,
  .p
  {
    margin: 1em 0;
  }
  h3,
  .h3
  {
    font-size: 1.25em;
    margin: 0.75em 0;
    font-weight: bold;
  } 
}
.lang
{
  position: absolute;
  right:  0;
  top:    0;
  border: 0;
  padding: 0.25em 0.5em;
  background-color: #FFDF7F;
  
  abbr
  {
    border: none;
  }
}
            
          
!
            
              $(function(){
  
  $('.intro').on('click', 'button', function(){

      $('.bloc').toggleClass('css');
    });
  $('[data-html]').each(function(){

    $(this).html($(this).data('html')
                 .replace(/\[/g,'<')
                 .replace(/\]/g,'>')
                 .replace(/'/g,'"'));
  });
  
  var main    = $('.main'),
      strings = $('[data-lang-en]');
  
  var d = new Date();
      d.setTime(d.getTime() + (30*24*60*60*1000));
  var expires = d.toUTCString();
      
	strings.each(function(){

    $(this).data('lang-fr', $(this).html()
                 .replace(/</g, "[")
                 .replace(/>/g, "]")
                 .replace(/"/g, "'"));
  });
  
	$('.lang').on('click', function(){
  	
    if(main.attr('lang') === 'en')
    {
      
      $(this).attr('lang', 'en'); 
      main.attr('lang', 'fr');
      
      document.cookie="demolang=fr; expires="+  expires +"; path=/";
      
      strings.each(function(){
      	$(this).html($(this).data('lang-fr')
                 .replace(/\[/g,'<')
                 .replace(/\]/g,'>')
                 .replace(/'/g,'"'));
      });
    }
    else
    {
      main.attr('lang', 'en');
      $(this).attr('lang', 'fr');
      
      document.cookie="demolang=en; expires="+  expires +"; path=/";
      
      strings.each(function(){
      	$(this).html($(this).data('lang-en')
                 .replace(/\[/g,'<')
                 .replace(/\]/g,'>')
                 .replace(/'/g,'"'));
      });
		}
  });
  
    var cookies = document.cookie.split(';');
  
    for(var i=0; i<cookies.length; i++) {
        var c = cookies[i];
        while (c.charAt(0)==' ') c = c.substring(1);
        if (c.indexOf('demolang=') != -1)
        {
					if(c.substring('demolang='.length, c.length) === 'en')
            {
						$('.lang').trigger('click');
            }
        }
    }
    
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console