Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .card-c
  .image
  .avatar
  .data
    .raised $12,345
    .pb
      .pb-raised
    .username username
    .campaign-name Campaign name goes here and can go onto two lines
    
    
.card-e
  .avatar
  .data
    .causename Cause name goes here
    .fe-name Fundraising event name goes here  
    .raised $12,345
    .pb
      .pb-raised
    .btn Start fundraising

.card-ch
  .cause
    .avatar
    .causename Cause name goes here and it could be quite long
  .campaign-name Cause description can go here and it can go on up to a certain amount of characters on to three lines… 
  .events 
    %span Events
    .number 2
    .event-list
      .event Event name one goes here
      .event Event name one goes here
              
            
!

CSS

              
                body {
  padding: 3rem 1rem;
  background: #EEF1F4;
  font-family: 'Work Sans', sans-serif;
  line-height: 1.2;
  color: #1F2124;
}

*, *:hover {
  transition: all 0.4s ease-in-out;
}

.card-c {
  vertical-align:top;
  width: 16.5rem;
  display:inline-block;
  background: white;
  border-radius: 6px;
  position: relative;
  margin-right: 1rem;
  margin-left: 1rem;
  &:hover {
    cursor:pointer;
    box-shadow: 0 4px 12px 0 rgba(0,0,0,0.30);
    .image {
      background-size: 102%;
    }
    .avatar {
      opacity: 1;
      transform: translateY(-2rem);
      box-shadow: 0 4px 12px 0 rgba(0,0,0,0.30);
    }
  }
  .image {
    width: 100%;
    height: 140px;
    background: url("https://images.unsplash.com/photo-1591295360405-33d6c25c4a25?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=900&q=60") no-repeat center top;
    background-size: 100%;
    border-radius: 6px 6px 0 0;
  }
  .avatar {
    width: 48px;
    height: 48px;  
    background: url("https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=934&q=80")no-repeat center top;
    background-size: cover;
    border-radius: 4px;
    margin-left: auto;
    margin-right: auto;
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(-0.8rem);
  }
  .data {
    padding: 15px;
    .raised {
      font-weight: 700;
      font-size: 0.875rem;
    }
    .pb {
      position: relative;
      background: #DDDBE8;
      height: 4px;
      border-radius: 8px;
      width: 100%;
      margin-top: 2px;
      .pb-raised {
        position: absolute;
        left: 0;
        height: 4px;
        background: #20861D;
        width: 60%;
        border-radius: 8px;
      }
    }
    .username {
      font-weight: 400;
      font-size: 1em;
      margin-top: 0.75rem;
    }
    .campaign-name {
      font-weight: 700;
      font-size: 0.9125em;
      margin-top: 0.5rem;
    }
  }
}

.card-e {
  width: 16.5rem;
  display:inline-block;
  background: white;
  border-radius: 6px;
  position: relative;
  margin-right: 1rem;
  margin-left: 1rem;
  vertical-align: top;
  text-align: center;
  &:hover {
    cursor:pointer;
    box-shadow: 0 4px 12px 0 rgba(0,0,0,0.30);
    .avatar {
      opacity: 1;
      transform: translateY(-2.4rem);
      box-shadow: 0 4px 12px 0 rgba(0,0,0,0.30);
    }
    .btn {
        background: #20861D;
        color: #ffffff !important;
      }
  }
  
  .avatar {
    width: 64px;
    height: 64px;  
    background: url("https://images.unsplash.com/photo-1533319417894-6fbb331e5513?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=975&q=80")no-repeat center top;
    background-size: cover;
    border-radius: 4px;
    margin-left: auto;
    margin-right: auto;
    position: absolute;
    left: 0;
    right: 0;
    transform: translateY(-2rem);
    
  }
  .data {
    padding: 15px;
    .raised {
      font-weight: 700;
      font-size: 0.875rem;
      text-align: left;
      margin-top: 1rem;
    }
    .pb {
      position: relative;
      background: #DDDBE8;
      height: 4px;
      border-radius: 8px;
      width: 100%;
      margin-top: 2px;
      .pb-raised {
        position: absolute;
        left: 0;
        height: 4px;
        background: #20861D;
        width: 60%;
        border-radius: 8px;
      }
    }
    .causename {
      font-weight: 400;
      font-size: 1em;
      margin-top: 2rem;
    }
    .fe-name {
      font-weight: 700;
      font-size: 1.125em;
      margin-top: 0.5rem;
    }
    .stats-wrap {
      margin-top: 1rem;
      .fundraisers, .teams {
        width: 48%;
        display: inline-block;
        .strong {
          font-weight: 700;
        }
      }
    }
    .btn {
      border: 2px solid #20861D;
      border-radius: 4px;
      padding: 0.5rem;
      color: #20861D;
      margin-top: 1rem;
      
    }
  }
}

.card-ch {
  width: 24rem;
  display:inline-block;
  background: white;
  border-radius: 6px;
  position: relative;
  margin-right: 1rem;
  margin-left: 1rem;
  padding: 16px;
  &:hover {
    cursor:pointer;
    box-shadow: 0 4px 12px 0 rgba(0,0,0,0.30);
    .events span {
       margin-bottom: 1rem;
    }
    .event-list {
      opacity: 1 !important;
      height: 54px !important;
      transition: all 0.2s ease-in-out;
    }
  }
  .cause { 
    display: grid;
    grid-template-columns: repeat(1, 64px auto ) ;
		grid-template-rows: repeat(1, 100%);
    grid-gap: 16px;
    .avatar {
      width: 64px;
      height: 64px;  
      background: url("https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F0%2F0c%2FPinkArgyle.svg%2F1200px-PinkArgyle.svg.png&f=1&nofb=1")no-repeat center top;
      background-size: cover;
      border-radius: 4px;
      display: inline-block;
      }

    .causename {
        font-weight: 600;
        font-size: 1.125em;
        margin-top: 0.75rem;
        display: inline-block;
        vertical-align: top;
      }
      
    }
  .campaign-name {
        font-weight: 400;
        font-size: 1em;
        line-height: 1.4rem;
        padding-top: 1rem;
        display: block;
      }
  .events {
    position: relative;
    border-top: 1px solid #DDDBE8;
    margin-top: 1rem;
    span {
    padding-top: 1rem;
    display: inline-block;
    font-weight: 700;
    font-size: 1.125rem;

  }
  .number {
    display: inline-block;
    padding: 0px;
    color: white;
    background: #196FCC;
    border-radius: 100%;
    width: 20px;
    height: 20px;
    text-align:center;
    font-size: 0.875rem;
    line-height: 1.2rem;
    vertical-align: center;
    top: -1px;
    position: relative;
    }
    .event-list {
      height: 0;
      display: block;
      opacity: 0;
      transition: all 0.2s ease-in-out;
    }
    .event {
      color: #196FCC;
      line-height: 1.6rem;
      display: block;

      &:before {
        content: '>';
        padding-right: 0.5rem;
        text-decoration: none !important;
      }
    }
    .event:first-of-type {
      padding-top: 0rem;
    }
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console