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

              
                <html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">  
  <title>Percent (responsive) approach for I heart CSS calc() blog post</title>
</head>

<body>


  <main>

    <article class="comment">
      <div class="comment__author-picture ">
        <i class="fa fa-user"></i> 
      </div>
      <h3 class="comment__title">
        My great comment
      </h3>
      <div class="comment__author-name-date">
        by Jane Doe on March 2, 2016
      </div>
      <div class="comment__content">
        <p>“Lorem Ipsum. Proin gravida nibh vel velit auctor aliquet. Aenean sollicitudin, lorem quis bibendum auctor, nisi elit consequat ipsum, nec sais sem.”</p>
      </div>
    </article>

  </main>

</body>

</html>
              
            
!

CSS

              
                @import "bourbon"
@import "neat"

$base-font-family: 'Open Sans', sans-serif
$base-font-color: #888
$base-font-size: 14px
$base-line-height: 1.6em

$medium-screen-up: new-breakpoint(min-width em(600px))
$large-screen-up: new-breakpoint(min-width em(715px))

body
  padding: 20px
  color: $base-font-color
  font-family: $base-font-family
  font-size: $base-font-size
  line-height: $base-line-height

main
  max-width: 800px
  margin-right: auto
  margin-left: auto
  
.comment
  background: #EEE
  border: solid 1px #CCC
  padding: 20px

.comment__author-picture
  position: relative
  float: left
  display: inline-block
  width: 25%
  margin-right: 5%
  margin-bottom: 20px
  padding-bottom: 25%
  background-color: #FFF
  border: solid 1px #CCC
  border-radius: 50%
  color: #CCC
  font-size: 40px
  line-height: 53px
  text-align: center
  .fa
    @include position(absolute, 0 0 null 0)
    margin-top: 50%
    @include transform(translateY(-50%))

  @include media($medium-screen-up)
    width: 13%
    margin-right: 3%
    padding-bottom: 13%
   
  @include media($large-screen-up)
    width: 11%
    margin-right: 3%
    padding-bottom: 11%
   
.comment__title
  float: left
  display: inline-block
  width: 70%
  margin-top: 8px
  margin-bottom: 3px
  color: #000
  font-size: 18px
  font-weight: normal
  
  @include media($medium-screen-up)
    width: 84%
  
  @include media($large-screen-up)
    width: 86%

.comment__author-name-date
  float: left
  display: inline-block
  width: 70%
  
  @include media($medium-screen-up)
    width: 84%

  @include media($large-screen-up)
    width: 86%
 
.comment__content
  clear: both

  @include media($medium-screen-up)
    width: 84%
    margin-left: 16%

  @include media($large-screen-up)
    width: 86%
    margin-left: 14%
              
            
!

JS

              
                
              
            
!
999px

Console