Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                script#template(type='text/js-render').
  <div class="col">
  <div class="name">
  <h2 class="name">{{:name}}</h2>
  <p class="position">{{:position}}</p>
  </div>
  <div class="info">
  <ul class="info-list">
  <li class="list-item mail">{{:email}}</li>
  <li class="list-item tel">{{:phone}}</li>
  </ul>
  </div>
  </div>

.wrap
  #row
    .top
      .top-left
        .border-h
        .border-v
      .top-center
        .border-v
      .top-right
        .border-h
        .border-v
      .vline-1
      .vline-2
      .vline-3
      .vline-4
    #insert
    .bottom
      .bottom-left
        .border-h
        .border-v
      .bottom-center
        .border-v
      .bottom-right
        .border-h
        .border-v
              
            
!

CSS

              
                *
  box-sizing border-box
*>*:last-child
  margin-bottom 0 !important
.wrap
  display flex
  flex-flow row wrap
  align-items center
  justify-content center
  align-content center
  padding-top 5mm
  padding-bottom 5mm
  width 210mm
  height 297mm
#insert
  width calc( 91mm * 2 )
  display flex
  flex-flow row wrap
.col
  position relative
  width 91mm
  height 55mm
  background #fff
  padding 5mm
  display flex
  flex-flow row wrap
  align-items center
  .name
    font-size 18pt
    margin-bottom .5em
  .position
    font-size 10pt
.info
  position absolute
  display block
  bottom 5mm
  right 5mm
  &-list
    font-size 10.5pt
    .list-item
      margin-bottom .5em
@page
  size A4
  margin 0

.top
  position relative
  width 100%
.top-left
  position relative
  .border-h
    position absolute
    content ''
    display block
    width 5mm
    height .5pt
    background red
    top -.5pt
    left -5mm
    z-index 1
  .border-v
    position absolute
    content ''
    display block
    background red
    width 1pt
    height 5mm
    top -5mm
    left -1pt
    z-index 1
.top-center
  .border-v
    position absolute
    content ''
    display block
    background blue
    width 1pt
    height 5mm
    top -5mm
    left calc(50% - 0.5pt)
    z-index 1
.top-right
  .border-h
    position absolute
    content ''
    display block
    background red
    width 5mm
    height 1pt
    top 1pt
    right calc(-5mm + 1pt)
    z-index 1
 .border-v
    position absolute
    content ''
    display block
    background red
    width 1pt
    height 5mm
    top calc(-5mm + 1pt)
    right 1pt
    z-index 1
.bottom
  position relative
  .bottom-left
    .border-h
      position absolute
      content ''
      display block
      background red
      width 5mm
      height 1pt
      z-index 1
      bottom -1pt
      left -5mm
    .border-v
      position absolute
      content ''
      display block
      background red
      width 1pt
      height 5mm
      z-index 1
      bottom calc( 5mm - 1pt )
      top 0
      left -1pt
  .bottom-center
    .border-v
      background blue
      left calc(50% - 0.5pt)
      top 0
      bottom 5mm
  .bottom-right
    .border-h
      position absolute
      content ''
      display block
      background red
      width 5mm
      height 1pt
      z-index 1
      top 0
      bottom -1pt
      right -5mm
    .border-v
      top 0
      bottom calc( 5mm - 1pt )
      right -1pt
[class^="vline-"]
  position relative
  &:before
    position absolute
    content ''
    display block
    width 5mm
    height 1pt
    background blue
    z-index 1
    top 0
    left -5mm
  &:after
    position absolute
    content ''
    display block
    width 5mm
    height 1pt
    background blue
    z-index 1
    top 0
    right -5mm
.vline-1
  &:before,&:after
    top calc(55mm - 0.5pt)
.vline-2
  &:before,&:after
    top calc(55mm * 2 - 0.5pt)
.vline-3
  &:before,&:after
    top calc(55mm * 3 - 0.5pt)
.vline-4
  &:before,&:after
    top calc(55mm * 4 - 0.5pt)
    
              
            
!

JS

              
                var data = [
  { 
    name: "Taro YAMADA",
    position: 'CEO/President',
    email: 't.yamada@example.com',
    phone: '06-1234-5678'
  },
  { 
    name: "Yukio MURATA",
    position: 'COO/Vice President',
    email: 'y.murata@example.com',
    phone: '06-1234-5678'
  },
  { 
    name: "Keiko YASUKAWA",
    position: 'CFO',
    email: 'k.yasukawaexample.com',
    phone: '06-1234-5678'
  },
{ 
    name: "Taro YAMADA",
    position: 'CEO/President',
    email: 't.yamada@example.com',
  phone: '06-1234-5678'
  },
  { 
    name: "Yukio MURATA",
    position: 'COO/Vice President',
    email: 'y.murata@example.com',
    phone: '06-1234-5678'
  },
  { 
    name: "Keiko YASUKAWA",
    position: 'CFO',
    email: 'k.yasukawa@example.com',
    phone: '06-1234-5678'
  },
{ 
    name: "Taro YAMADA",
    position: 'CEO/President',
    email: 't.yamada@example.com',
  phone: '06-1234-5678'
  },
  { 
    name: "Yukio MURATA",
    position: 'COO/Vice President',
    email: 'y.murata@example.com',
    phone: '06-1234-5678'
  },
{ 
    name: "Taro YAMADA",
    position: 'CEO/President',
    email: 't.yamada@example.com',
  phone: '06-1234-5678'
  },
  { 
    name: "Yukio MURATA",
    position: 'COO/Vice President',
    email: 'y.murata@example.com',
    phone: '06-1234-5678'
  },
]
var html = $('#template').render(data)
$('#insert').append(html)
              
            
!
999px

Console