cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.

            
              .centerline

h1 Problem
h2 float 1
.row.float-1
    .left left
    .center center
    .right right
br
.row.float-1
    .left left
    .center center
    .right rightreallylongtexthere

h2 flex 1
.row.flex-1
    .left left
    .center center
    .right right
br
.row.flex-1
    .left left
    .center center
    .right rightreallylongtexthere

br
br
br

h1 Solution
h2 float 2 
.row.float-2
    span.left
        span left
    span.center 
        span center
    span.right 
        span right
br
.row.float-2
    span.left
        span left
    span.center 
        span center
    span.right 
        span rightreallylongtexthere

h2 flex 2
.row.flex-2
    span.left
        span left
    span.center 
        span center
    span.right 
        span right
br
.row.flex-2
    span
        .left left
    span
        .center center
    span
        .right rightreallylongtexthere
br
br
            
          
!
            
              @mixin flexbox($d, $w, $j, $a){
    display: flex;
    flex-direction: $d;
    flex-wrap: $w;
    justify-content: $j;
    align-items: $a;
}

@mixin clearfix() {
    &:after {
        content: "";
        display: table;
        clear: both;
    }
}

.centerline{
    position: fixed;
    top: 0;
    left: 50%;
    width: 10px;
    height: 100%;
    background: red;
    transform: translateX(-50%);
    opacity: .5;
}

.row{
    position: relative;
    margin: 0 auto;
    width: 80%;
    max-width: 1400px;
    font-family: Roboto, Calibri, Arial;
    font-size: 20px;
    border: 1px solid black;
    background: rgba(black, .2);
    
    .left, .right, .center{
        background: rgba(white, .8);
    }
}

.float-1{
    @include clearfix();
    text-align: center;
        
    .left{
        float: left;
    }
    
    .right{
        float: right;
    }    
    
    .center{
        margin: 0 auto;
        display: inline-block;
        position: relative;
    }
}


.float-2{
    @include clearfix();
    text-align: center;
    
    span{
        width: (100%/3);
        &:nth-of-type(1){
            text-align: left;
        }
        &:nth-of-type(2){
            text-align: center;
        }
        &:nth-of-type(3){
            text-align: right;
        }
    }
    
    .left{
        float: left;
    }
    
    .right{
        float: right;
    }    
}

.flex-1{
    @include flexbox(row, wrap, space-between, center);
}

.flex-2{
    @include flexbox(row, wrap, flex-start, center);
    span{
        flex: 1;
        &:nth-of-type(1){
            text-align: left;
        }
        &:nth-of-type(2){
            text-align: center;
        }
        &:nth-of-type(3){
            text-align: right;
        }
    }
}

h1,
h2 {
    padding: 0 10%;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console