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.

              <body class="section2">
            <li class="home">home</li>
            <li class="section2">Section2</li>
            <li class="section3">section3</li>
            <li class="anothersection">anothersection</li>
            <li class="keepaddingasmany">keepaddingasmany</li>
            <li class="sectionsasyouneed">sectionsasyouneed</li>
  <h1>This is a site header with color and border set</h1>
    <div class="content">
        This is section specific stuff, inheriting the background of the section, specified on the body class.
              $primaryColors: (home #E73159)
                (section2 #B0C038)
                (section3 #FDAD00)
                (anothersection #CB8840)
                (keepaddingasmany #EAA3C5)
                (sectionsasyouneed #8FBDCB);

@mixin section-color($properties:(background-color),$context:"body"){
  @if ($context=="&") {
  @each $i in $primaryColors {
    #{$context}.#{nth($i,1)} #{$postContext} {
      @each $property in $properties {
  border:1px solid black;
  @include section-color((color,border-color));

.content {
   @include section-color();



    @include section-color($context:"&");
Loading ..................