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.

            
              <!-- :scope -->
<div class="example-cntr scope">
    <h1>CSS <code>:scope</code> pseudo-class</h1>    
    <p>The <code>:scope</code> pseudo-class makes more sense when it’s tied to the <code>scoped</code> HTML attribute in a <code>&lt;style></code> tag. If there is no <code>scoped</code> attribute in a <code>&lt;style></code> tag within a section of the page, then the <code>:scope</code> pseudo-class will scope all the way out to the <code>&lt;html></code>, which is the default scope of a style sheet.</p>
    <p><em>Note: Firefox is the only one that supports this pseudo-class. That’s why we see this text in italics in all other browsers.</em></p>
    <p>In the following example, this HTML block has a <code>scoped</code> style sheet in the markup. All text inside the second <code>&lt;section></code> will be in italics:</p>
    <article>
        <section>
            <h1>Section 1 Heading</h1>
            <p>Lorem ipsum dolor sit amet.</p>
        </section>
        <section>
            <style scoped>
                :scope{
                    font-style: italic;
                    color:red;
                }
            </style>
            <h1>Section 2 Heading</h1>
            <p>This text will be italicized.</p>
        </section>
    </article>

</div>
            
          
!
            
              //:scope
.scope {
    article {
        padding: 40px;
        font: 22px Garamond;
        color: lighten($g,30);
    }
    h1 { text-align: left; }
    em { text-decoration: underline; }
}


//Styling stuff not needed for demo
body { text-align: left; }
h1 {
    font-size: 22px;
    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);
    & > h1 { text-align: center; }
}
            
          
!
999px
Loading ..................

Console