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.

            
              <!-- First Component / Premier Composant -->
<header class="my-header">
  <div class="ui">
    <h1 class="my-header--title">I am Title</h1>
  </div>
</header>

<!-- Second Component / Deuxième Composant -->
<nav class="my-menu">
  <div class="ui">
    <div class="my-menu--links">
      <ul>
        <li><a href=""><span>Home</span></a></li>
        <li><a href=""><span>Magazine</span></a></li>
        <li><a href=""><span>Profile</span></a></li>
        <li><a href=""><span>Settings</span></a></li>
        <li><a href=""><span>About</span></a></li>
      </ul>  
  </div>
</nav>

<!-- Third Component / Troisième Composant -->
<div class="my-content">
  <div class="ui">
    <div class="my-content--text">
      <p><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Conventions HTML et CSS orientés composants</a>. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab nesciunt nemo amet culpa veniam molestias provident laudantium officia, aut ipsa quae doloremque, tempore, non ipsam quis nihil itaque deleniti pariatur.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab nesciunt nemo amet culpa veniam molestias provident laudantium officia, aut ipsa quae doloremque, tempore, non ipsam quis nihil itaque deleniti pariatur.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab nesciunt nemo amet culpa veniam molestias provident laudantium officia, aut ipsa quae doloremque, tempore, non ipsam quis nihil itaque deleniti pariatur.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab nesciunt nemo amet culpa veniam molestias provident laudantium officia, aut ipsa quae doloremque, tempore, non ipsam quis nihil itaque deleniti pariatur.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab nesciunt nemo amet culpa veniam molestias provident laudantium officia, aut ipsa quae doloremque, tempore, non ipsam quis nihil itaque deleniti pariatur.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab nesciunt nemo amet culpa veniam molestias provident laudantium officia, aut ipsa quae doloremque, tempore, non ipsam quis nihil itaque deleniti pariatur.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab nesciunt nemo amet culpa veniam molestias provident laudantium officia, aut ipsa quae doloremque, tempore, non ipsam quis nihil itaque deleniti pariatur.</p>
    </div>
    <aside class="my-content--ads">
      <ul>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Conventions HTML et CSS orientés composants</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Conventions HTML et CSS orientés composants</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Vestibulum auctor dapibus neque.</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Aliquam tincidunt mauris eu risus.</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Vestibulum auctor dapibus neque.</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Conventions HTML et CSS orientés composants</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Aliquam tincidunt mauris eu risus.</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Vestibulum auctor dapibus neque.</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Vestibulum auctor dapibus neque.</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Conventions HTML et CSS orientés composants</a></li>
        <li><a href="http://blog.lesieur.name/conventions-html-et-css-orientes-composants/">Vestibulum auctor dapibus neque.</a></li>
      </ul>  
    </aside>
  </div>
</div>
  
<!-- Fourth Component / Quatrième Composant -->
<footer class="my-footer">
  <div class="ui">
    <div class="my-footer--copyright">©All right not reserved at all</h1>
  </div>
</footer>
  
<select name="choice">
  <option value="">Choose your Design</option>
  <option value="">---------------------</option>
  <option value="as-one-page">One Page</option>
  <option value="as-simple-page">Simple Page</option>
  <option value="as-design-page">Design Page</option>
  <option value="as-backoffice-page">BackOffice Page</option>
  <option value="as-grid-page">Grid Page</option>
  <option value="as-popup-page">Popup Example</option>
  <option value="as-appmobile-page">App Mobile Example</option>
</select>
            
          
!
            
              /* La totalité en une page */
@screen-tablet: 768px;
* {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}
body {
  background-color: #eee;
}
select {
  position: fixed;
  top: 0;

  right: 0;
  width: auto;
  height: auto;
}
option {
  width: auto;
  height: auto;
}

.as-one-page {
  .ui {
    padding: 10px 15px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .my-header {
    background-color: #ccc;
  }

  .my-menu {
    background-color: #bbb;

    ul {
      margin: 0;
      padding: 0;
    }

    li {
      display: inline-block;
      & + li {
        &:before {
          content: '|';
          margin-right: 8px;
          margin-left: 8px;
        }
      }
    }
  }

  .my-content {
    background-color: #ddd;
  }

  .my-footer {
    padding: 10px 15px;
    background-color: #bbb;
  }
}

.as-simple-page {
  .ui {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .my-header {
      .ui {
        padding: 10px 15px;
        background-color: #ccc;
      }
  }

  .my-menu {
    .ui {
      padding: 10px 15px;
      background-color: #bbb;
    }

    ul {
      margin: 0;
      padding: 0;
    }

    li {
      display: inline-block;
      & + li {
        &:before {
          content: '|';
          margin-right: 8px;
          margin-left: 8px;
        }
      }
    }
  }

  .my-content {
    .ui {
      padding: 10px 15px;
      background-color: #ddd;
    }
  }

  .my-footer {
    .ui {
      padding: 10px 15px;
      background-color: #bbb;
    }
  }
}

body.as-design-page {
  background-image: url('http://blog.haeresis.fr/upload/image/the_moment_by_dzsurnik.jpg');
  background-size: cover;
  background-position: center center;
}
.as-design-page {

  .ui {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .my-header {
    .ui {
      padding: 10px 15px;
      background-color: rgba(0, 180, 180, 0.5);
    }
  }

  .my-menu {
    background-color: rgba(180, 180, 180, 0.7);
    .ui {
      padding: 10px 15px;
    }

    ul {
      margin: 0;
      padding: 0;
    }

    li {
      display: inline-block;
      & + li {
        &:before {
          content: '|';
          margin-right: 8px;
          margin-left: 8px;
        }
      }
    }
  }

  .my-content  {
    .ui {
      padding: 10px 15px;
      background-color: rgba(180, 180, 0, 0.8);
    }
  }

  .my-footer {
    background-color: rgba(0, 180, 0, 0.7);
    .ui {
      padding: 10px 15px;
    }
  }
}

.as-backoffice-page {
  .ui {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .my-header {
    background-color: #ccc;
    .ui {
      padding: 10px 15px;
    }
  }

  .my-menu {
    .ui {
      background-color: #eee;
      padding: 10px 15px;
    }

    ul {
      margin: 0;
      padding: 0;
    }

    li {
      display: inline-block;
      & + li {
        &:before {
          content: '|';
          margin-right: 8px;
          margin-left: 8px;
        }
      }
      @media (min-width: @screen-tablet) {
        display: block;
        text-align: right;
        & + li {
          border-top: 1px solid #ccc;
          margin-top: 8px;
          padding-top: 8px;
          &:before {
            content: '';
            margin-right: 0;
            margin-left: 0;
          }
        }
      }
    }

    @media (min-width: @screen-tablet) {
      position: relative;
      width: 20%;
      .ui {
        width: 100%;
        max-width: none;
        position: absolute;
      }
    }
  }

  .my-content  {
    .ui {
      padding: 10px 15px;
      background-color: #ddd;
    }

    @media (min-width: @screen-tablet) {
      position: relative;
      margin-left: 20%;
      width: 80%;
      .ui {
        max-width: none;
      }
    }
  }

  .my-footer {
    background-color: #bbb;
    .ui {
      padding: 10px 15px;
    }
  }
}

.as-grid-page {
  .ui {
    float: left;
  }

  .my-header {
      max-width: 1000px;
      margin-left: auto;
      margin-right: auto;
      .ui {
        width: 100%;
        @media (min-width: @screen-tablet) {
          width: 33.33333333%;
        }
        padding: 10px 15px;
        background-color: #ccc;
      }
  }

  .my-menu {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    .ui {
      width: 100%;
      @media (min-width: @screen-tablet) {
        width: 66.66666666%;
      }
      padding: 10px 15px;
      @media (min-width: @screen-tablet) {
        padding: 4px 15px;
      }
      background-color: #eee;
    }

    ul {
      margin: 0;
      padding: 0;
    }

    li {
      display: inline-block;
      & + li {
        &:before {
          content: '|';
          margin-right: 8px;
          margin-left: 8px;
        }
      }
      @media (min-width: @screen-tablet) {
        display: block;
        & + li {
          &:before {
            content: '';
            margin-right: 0;
            margin-left: 0;
          }
        }
      }
    }
  }

  .my-content {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    .ui {
      width: 100%;
      padding: 10px 15px;
      background-color: #ddd;
    }
  }

  .my-footer {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    .ui {
      width: 100%;
      @media (min-width: @screen-tablet) {
        margin-left: 75%;
        width: 25%;
        text-align: center;
      }
      padding: 10px 15px;
      background-color: #bbb;
    }
  }
}

.as-popup-page {
  .ui {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .my-header {
      .ui {
        padding: 10px 15px;
        background-color: #ccc;
        position: relative;

        &:before {
          content: 'Click Here to Open Menu';
          position: absolute;
          top: 5px;
          cursor: pointer;
          left: 5px;
          cursor: pointer;
        }
      }
  }

  .my-menu {
    display: none;
    &.is-opened {
      display: block;
    }

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;

    .ui {
      position: absolute;
      top: 20px;
      left: 20px;
      right: 20px;
      bottom: 20px;

      @media (min-width: @screen-tablet) {
        top: 50%;
        left: 50%;
        -webkit-transform: translate(-50%, -50%);
           -moz-transform: translate(-50%, -50%);
            -ms-transform: translate(-50%, -50%);
             -o-transform: translate(-50%, -50%);
                transform: translate(-50%, -50%);
      }
      padding: 40px;
      max-width: none;
      background-color: #eee;
      cursor: default;

      &:after {
        content: 'Close';
        position: absolute;
        top: 5px;
        cursor: pointer;
        right: 5px;
      }
    }

    ul {
      margin: 0;
      padding: 0;
    }

    li {
      display: inline-block;
      & + li {
        &:before {
          content: '|';
          margin-right: 8px;
          margin-left: 8px;
        }
      }
    }
  }

  .my-content {
    .ui {
      padding: 10px 15px;
      background-color: #ddd;
    }
  }

  .my-footer {
    .ui {
      padding: 10px 15px;
      background-color: #bbb;
    }
  }
}

  .cover {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
  }
  .center {
      position: absolute;
      top: 50%;
      left: 50%;
      -webkit-transform: translate(-50%, -50%);
         -moz-transform: translate(-50%, -50%);
          -ms-transform: translate(-50%, -50%);
           -o-transform: translate(-50%, -50%);
              transform: translate(-50%, -50%);
  }

.as-appmobile-page {
  .my-header {
    height: 6rem;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #ccc;

    .ui {
      &:extend(.center);
      white-space: nowrap;
    }
  }

  .my-menu {
    height: 6rem;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: #eee;

    .ui {
      &:extend(.cover);
    }
    ul {
      margin: 0;
      padding: 0;
      list-style-type: none;
      &:extend(.cover);
    }

    li {
      display: inline-block;
      width: 20%;
      position: absolute;
      height: 100%;

      &:nth-child(2) {
        left: 20%;
        background-color: #dddddd;
      }
      &:nth-child(3) {
        left: 40%;
      }
      &:nth-child(4) {
        left: 60%;
        background-color: #dddddd;
      }
      &:nth-child(5) {
        left: 80%;
      }

    } 
    a {
      &:extend(.cover);
    }
    span {
      &:extend(.center);
    }
  }
  .my-menu--links {
    &:extend(.cover);
  }

  .my-content {
    position: absolute;
    top: 6rem;
    bottom: 6rem;
    width: 100%;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #fff;

    .ui {
      padding: 10px 20px;
      max-width: 1200px;
      margin-left: auto;
      margin-right: auto;
    }
  }

  .my-footer {
    display: none;
    .ui {
      &:extend(.center);
    }
    @media (min-width: @screen-tablet) {
      display: block;
      height: 6rem;
      width: 18rem;
      position: absolute;
      top: 0;
      right: 0;
      background-color: #bbb;
    }
  }
}
            
          
!
            
              var website = {};
website.components = website.components || {};

/* Add my-header component */
(function (publics) {
  var name = "my-header",
      component = publics.components.myHeader = {};

  component.init = function () {
    website.components.myMenu.openPopup($("." + name));
  }
}(website));

/* Add my-menu component */
(function (publics) {
  var name = "my-menu",
      component = publics.components.myMenu = {};
  
  component.closePopup = function () {
    $("." + name).click(function () {
      $(this).removeClass("is-opened");
    }).find("." + name + "--links").click(function (e) {
      e.stopPropagation();
    });
  };
  
  component.openPopup = function ($target) {
    $target.click(function () {
      $("." + name).addClass("is-opened");
    });
  };
  
  component.init = function () {
    website.components.myMenu.closePopup();
  }
}(website));

/* Add common function */
(function (publics) {
  
  publics.changeDesign = function () {
    $("select").change(function (e) {
      $("body").removeClass("as-one-page")
               .removeClass("as-simple-page")
               .removeClass("as-backoffice-page")
               .removeClass("as-grid-page")
               .removeClass("as-popup-page")
               .removeClass("as-appmobile-page")
               .removeClass("as-design-page");
      $("body").addClass($("option:selected").attr("value"));
    });
  };
  
  publics.init = function () {
    website.changeDesign();
  }
}(website));

/* Execute all my components */
website.init();
for (var component in website.components) {
  if (website.components.hasOwnProperty(component)) {
    website.components[component].init();
  }
}
            
          
!
999px
Loading ..................

Console