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.

            
              <!-- :in-range -->
<section class="example-cntr ranges in-range">
    <h1>CSS <code>:in-range</code> pseudo-class</h1>
    <p>The <code>:in-range</code> pseudo-class targets elements that use a range and that the values are within the defined range.</p>
    <p>In the input below, the range is between 5 and 10: Values inside this range create a <span class="green">green</span> border.</p>
    <p>Type <em>555</em> and border color turns red. Type <em>8</em> and border color turns green.</p>
    <input type="number" min="5" max="10">
    <small><em>Press <code>TAB</code> if border color doesn't change when typing.</em></small>
</section>

<!-- :out-of-range -->
<section class="example-cntr ranges out-of-range">
    <h1>CSS <code>:out-of-range</code> pseudo-class</h1>  
    <p>The <code>:out-of-range</code> pseudo-class targets elements that use a range and that the values fall outside the defined range.</p>    
    <p>In the input below, the range is between 5 and 10: Values outside this range create a <span class="red">red</span> border.</p>
    <p>Type <em>555</em> and border color turns red. Type <em>8</em> and border color turns green.</p>
    <input type="number" min="5" max="10">
    <small><em>Press <code>TAB</code> if border color doesn't change when typing.</em></small>
</section>
            
          
!
            
              //'ranges' generic styles
.ranges {
    input[type=number] {
        box-sizing: content-box;
        width: 80px; height: 40px;
        padding: 4px;        
        border-radius: 3px;
        font-size: 22px;
        cursor: text;
        transition: .5s;
    }    
}

//:in-range
.in-range {
    input[type=number] {
        border: 5px solid $r;
    }    
    input[type=number]:in-range {
        border: 5px solid $g;
    }    
}

//:out-of-range
.out-of-range {
    input[type=number] {
        border: 5px solid $g;
    } 
    input[type=number]:out-of-range {
        border: 5px solid $r;
    }
}


//Styling stuff not needed for demo
body { text-align: left; }
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; }
.example-cntr {
    max-width: 800px;
    margin: 0 auto 50px;
    padding: 30px;
    box-shadow: 0 1px 2px rgba(black,.3);
    background: rgba(black,.15);
    &:last-of-type { margin-bottom: 0; }
}

.flex-ctnr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
small {
    display: block;
    margin: 20px 0 10px;
    padding-top: 10px;    
    text-align: center;
}

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

Console