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.

            
              <h2 class="title">Flexbox Example</h2>
<div class="flexbox">
    <p class="third-paragraph">In code, that means we have a User model, a Team model and a pivot table that establishes the connection between the two models.</p>
    <p>Since, most of the time this structure is present, it’s time to roll out a simple solution for handling roles that stored in the pivot table.</p>
</div>

<h2 class="title">Block Formatting Context Example</h2>
<div class="padding">
    <div style="display: inline-block;"></div>
    <p class="third-paragraph">In code, that means we have a User model, a Team model and a pivot table that establishes the connection between the two models.</p>
    <p>Since, most of the time this structure is present, it’s time to roll out a simple solution for handling roles that stored in the pivot table.</p>
</div>

<h2 class="title">Padding Example</h2>
<div class="padding">
    <p class="third-paragraph">In code, that means we have a User model, a Team model and a pivot table that establishes the connection between the two models.</p>
    <p>Since, most of the time this structure is present, it’s time to roll out a simple solution for handling roles that stored in the pivot table.</p>
</div>

<h2 class="title">Border Example</h2>
<div class="border">
    <p class="third-paragraph">In code, that means we have a User model, a Team model and a pivot table that establishes the connection between the two models.</p>
    <p>Since, most of the time this structure is present, it’s time to roll out a simple solution for handling roles that stored in the pivot table.</p>
</div>
            
          
!
            
              :root {
    box-sizing: border-box;
}

*,
::before,
::after {
    box-sizing: inherit;
}

body {
    font-family: 'Lato', sans-serif;
    padding: 40px;
    font-size: 120%;
    line-height: 1.5;
    color: #565656;
}

p,
.title {
    position: relative;
    margin: 20px 0;
    
    // margin-top display helper
    &::before {
        content: 'margin-top';
        color: rgba(0,0,0,0.4);
        font-size: 14px;
        position: absolute;
        top: -20px;
        right: 0;
        left: 0;
        background: rgba(167, 63, 188, 0.2);
        display: block;
        height: 20px;
        line-height: 20px;
        padding: 0 10px;
    }
    
    // margin-bottom display helper
    &::after {
        content: 'margin-bottom';
        color: rgba(0,0,0,0.4);
        font-size: 14px;
        position: absolute;
        bottom: -20px;
        right: 0;
        left: 0;
        background: rgba(63, 188, 162, 0.3);
        display: block;
        height: 20px;
        line-height: 20px;
        padding: 0 10px;
        text-align: right;
    }
}

.first-paragraph {
    margin-bottom: 40px;
    
    // margin-bottom display helper
    &::after {
        height: 40px;
        line-height: 40px;
        bottom: -40px;
    }
}

.second-paragraph {
    margin-top: 30px;
    
    // margin-top display helper
    &::before {
        height: 30px;
        line-height: 30px;
        top: -30px;
    }
}

.third-paragraph {
    margin-top: 60px;
    
    // margin-top display helper
    &::before {
        height: 60px;
        line-height: 60px;
        top: -60px;
    }
}

.title {
    margin-top: 80px;
    margin-bottom: 30px;
    
    // margin-top display helper
    &::before {
        height: 80px;
        line-height: 80px;
        top: -80px;
    }
    
    // margin-bottom display helper
    &::after {
        height: 30px;
        line-height: 30px;
        bottom: -30px;
    }
}

div {
    background: rgba(255, 255, 0, 0.15);
}

.flexbox {
    display: flex;
    flex-wrap: wrap;
    
    p {
        width: 100%;
    }
}

.padding {
    padding: 2px 0;
}

.border {
    border: 1px solid red;
}
            
          
!
999px
Loading ..................

Console