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

              
                <div class="arrow"></div>
<ul class="ChatLog">
  <li class="ChatLog__entry">
    <img class="ChatLog__avatar" src="//placekitten.com/g/50/50" />
    <p class="ChatLog__message">
      Hello!
      <time class="ChatLog__timestamp">6 minutes ago</time>
    </p>
  </li>
  <li class="ChatLog__entry">
    <img class="ChatLog__avatar" src="//placekitten.com/g/50/50" />
    <p class="ChatLog__message">
      What is going on here?
      <time class="ChatLog__timestamp">5 minutes ago</time>
    </p>
  </li>
  <li class="ChatLog__entry ChatLog__entry_mine">
    <img class="ChatLog__avatar" src="//placekitten.com/56/56" />
    <p class="ChatLog__message">
      I have no idea.
      <time class="ChatLog__timestamp">4 minutes ago</time>
    </p>
  </li>
  <li class="ChatLog__entry">
    <img class="ChatLog__avatar" src="//placekitten.com/g/50/50" />
    <p class="ChatLog__message">
      I have a neat idea. Maybe I should explain it to you in detail?
      <time class="ChatLog__timestamp">3 minutes ago</time>
    </p>
  </li>
  <li class="ChatLog__entry ChatLog__entry_mine">
    <img class="ChatLog__avatar" src="//placekitten.com/50/50" />
    <p class="ChatLog__message">
      Sure thing. The more detail the better. In fact, if you could provide definitions for every single term you use, that would be terrific!
      <time class="ChatLog__timestamp">2 minutes ago</time>
    </p>
  </li>
</ul>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #bbb;
}

ul.ChatLog {
  list-style: none;
}

.ChatLog {
  max-width: 20em;
  margin: 0 auto;
}
.ChatLog .ChatLog__entry {
  margin: .5em;
}

.ChatLog__entry {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  max-width: 100%;
}

.ChatLog__entry.ChatLog__entry_mine {
  flex-direction: row-reverse;  
  align-items: flex-end;
}

.ChatLog__avatar {
  flex-shrink: 0;
  flex-grow: 0;
  z-index: 1;
}

.ChatLog__entry.ChatLog__entry_mine .ChatLog__avatar {
  box-shadow: 2px 2px 0px #aaa;   
}

.ChatLog__entry .ChatLog__message {
  position: relative;
}

.ChatLog__entry .ChatLog__message::before {
  position: absolute;
  top: 0;
  right: auto;
  bottom: auto;
  left: -12px;
  height: 0;
  content: '';
  border: 6px solid transparent;
  border-top-color: #fff;
  border-right-color: #fff;
  z-index: 2;
}

.ChatLog__entry.ChatLog__entry_mine .ChatLog__message::before {
  top: auto;
  right: -12px;
  bottom: 0;
  left: auto;
  border: 6px solid transparent;
  border-bottom-color: #fff;
  border-left-color: #fff;
}

.ChatLog__message {
  background-color: #fff;
  padding: .5em;
  box-shadow: 2px 2px 0px #aaa; 
}

.ChatLog__message .ChatLog__timestamp {
  display: block;
  margin: .2em;
  font-size: 80%;
  color: #444;
}

              
            
!

JS

              
                
              
            
!
999px

Console