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.

            
              <!-- :checked -->
<section class="example-cntr checked">
    <h1>CSS <code>:checked</code> pseudo-class</h1>
    <p>The <code>:checked</code> pseudo-class targets <code>radio buttons</code>, <code>checkboxes</code> or <code>option</code> elements that have been checked or selected.</p>
    <p>In this example, when the checkbox is selected, the label is highlighted to improve the UX.</p>
    <form>
        <input type="checkbox" id="checked">
        <label for="checked">I agree with the Terms &amp; Conditions</label> 
    </form>
</section>
            
          
!
            
              //Colors
$r: #c03;
$g: #429032;
$b: #2963BD;
$y: #c90;

//:checked
:checked + label {
    background: $g;
    transition: .3s;
}


//Styling stuff not needed for demo
body { text-align: left; }
.example-cntr {
    max-width: 800px;
    margin: auto;
    padding: 20px 50px;    
    box-shadow: 0 1px 2px rgba(black,.3);
    background: rgba(black,.15);    
}
h1 {
    text-transform: none;
    border-bottom: #636363 1px dotted;
    code {
        display: inline-block;
        margin-bottom: 10px;
        color: $y;
        background: none;
        box-shadow: none;
    }
}
code { font-size: 1em; }
form {
    width: 400px;
    margin: 40px auto 20px;
    padding: 40px 20px;
    border-radius: 2px;
    font-size: 1.2em;
    text-align: center;
    background: rgba(black,.2);
}
input, label { cursor: pointer; }
input {
    width: 34px; height: 34px;
    vertical-align: middle;
    outline: none;
}
label {
    padding: 3px 8px 5px;
    border-radius: 2px;
    border: transparent 1px solid;    
    transition: .5s;
    &:hover {
        border: rgba(white,.2) 1px solid;        
    }
}


            
          
!
999px
Loading ..................

Console