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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <header><span class="left">Messages</span><h2>Jonathan Ive</h2><span class="right">Contact</span></header>
<div class="messages-wrapper">
  <div class="message to">This is my first text message on ios7 This is my first text message on ios7</div>
  <div class="message from">This is my second text message on ios7</div>
  <div class="message from">This is my third text message on ios7</div>
  <div class="message to">This is my fouth text message on ios7</div>
  <div class="message from">This is my fifth text message on ios7</div>
  <div class="message to">This is my sixth text message on ios7</div>
  <div class="message to">This is my seventh text message on ios7</div>
</div>
              
            
!

CSS

              
                
@import "https://fonts.googleapis.com/css?family=Open+Sans:400,600,700";
* {
    box-sizing: border-box;
}
body {
    background: none repeat scroll 0 0 #fff;
    color: #FFFFFF;
    font-family: "Open Sans";
    line-height: 26px;
    width: 400px;
    margin: 0 auto;
    overflow-X: hidden;
    position: relative;
}
.left {
  position: absolute;
  top: 0;
  left: 35px;
  font-size: 18px
}

.left:after {
    border: 3px solid #2095FE;
    border-right: 3px solid transparent;
    border-top: 3px solid transparent;
    content: " ";
    height: 14px;
    left: -20px;
    position: absolute;
    top: 20px;
    -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  transform: rotate(45deg);
    width: 14px;
}
.right {
  position: absolute;
  top: 0;
  right: 15px;
  font-size: 18px
}
header {
  color: #2095FE;
  background: #eee;
  border: 1px solid #ccc;
  border-bottom: 1px solid #bbb;
  box-shadow: 0 1px 2px rgba(1,1,1,0.2);
  height: 60px;
  text-align: center;
  font-size: 20px;
  line-height: 58px;
  white-space: nowrap;
  
}
header h2 {
  font-weight: bold;
  color: #111111;
}
.messages-wrapper {
  padding-top: 10px;
  position: relative;
  border: 1px solid #ddd;
  border-top: 0 none;
}
.message {
    border-radius: 20px 20px 20px 20px;
    margin: 0 15px 10px;
    padding: 15px 20px;
    position: relative;
}
.message.to {
    background-color: #2095FE;
    color: #fff;
    margin-left: 80px;
}
.message.from {
    background-color: #E5E4E9;
    color: #363636;
    margin-right: 80px;
}
.message.to + .message.to,
.message.from + .message.from {
  margin-top: -7px;
}
.message:before {
    border-color: #2095FE;
    border-radius: 50% 50% 50% 50%;
    border-style: solid;
    border-width: 0 20px;
    bottom: 0;
    clip: rect(20px, 35px, 42px, 0px);
    content: " ";
    height: 40px;
    position: absolute;
    right: -50px;
    width: 30px;
    z-index: -1;
}
.message.from:before {
    border-color: #E5E4E9;
    left: -50px;
    transform: rotateY(180deg);
}
              
            
!

JS

              
                
              
            
!
999px

Console