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

              
                <div id="chat-list">
  <input type="search" placeholder="Search Messages" id="search">
  <ul>
    <li>
      <img src="https://api.adorable.io/avatars/120/2" class="contact-img">
      <span class="contact-name">John Doe</span>
      <span class="message-excerpt">Lorem ipsum dolor sit amet und noch irgendein Käse</span>
    </li>
    <li>
      <img src="https://api.adorable.io/avatars/120/1" class="contact-img">
      <span class="contact-name">Marco Kaiser</span>
      <span class="message-excerpt">Hey, I wanted to asked you something important!</span>
    </li>
    <li>
      <img src="https://api.adorable.io/avatars/120/3" class="contact-img">
      <span class="contact-name">Larry Page</span>
      <span class="message-excerpt">Important Information: We must breathe!</span>
    </li>
    <li>
      <img src="https://api.adorable.io/avatars/120/4" class="contact-img">
      <span class="contact-name">Bill Gates</span>
      <span class="message-excerpt">Thanks for your Windows 8 app development!</span>
    </li>
    <li>
      <img src="https://api.adorable.io/avatars/120/5" class="contact-img">
      <span class="contact-name">Richard Roe</span>
      <span class="message-excerpt">I'm just a placeholder text</span>
    </li>
    <li>
      <img src="https://api.adorable.io/avatars/120/6" class="contact-img">
      <span class="contact-name">John Stiles</span>
      <span class="message-excerpt">Hey you :D</span>
    </li>
    <li>
      <img src="https://api.adorable.io/avatars/120/7" class="contact-img">
      <span class="contact-name">Richard Miles</span>
      <span class="message-excerpt">I'm not very potato!</span>
    </li>
  </ul>
</div>
<div id="contact-info">
  <figure id="the-contact">
    <img id="contact-img" src="https://api.adorable.io/avatars/600/2">
    <figcaption id="contact-meta">
      <h1 id="contact-name">John Doe</h1>
      <span id="lastseen">last seen 1 hour ago</span>
    </figcaption>
  </figure>
  <div id="media-gallery">
    <h2>Media</h2>
    <ul>
      <li><img src="http://placekitten.com/120/120"></li>
      <li><img src="http://placekitten.com/130/130"></li>
      <li><img src="http://placekitten.com/240/240"></li>
      <li><img src="http://placekitten.com/140/140"></li>
      <li><img src="http://placekitten.com/150/150"></li>
    </ul>
  </div>
</div>
<div id="chat-messages">
  <ul id="single-messages">
    <li class="from">
      <span class="text">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</span>
      <time class="sent-time">13:30</time>
    </li>
    <li class="from">
      <span class="text">At vero eos et accusam et justo duo dolores et ea rebum.</span>
      <time class="sent-time">13:31</time>
    </li>
    <li class="to">
      <span class="text">Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</span>
      <time class="sent-time">13:33</time>
    </li>
    <li class="from">
      <span class="text">At vero eos et accusam et justo duo dolores et ea rebum.</span>
      <time class="sent-time">13:34</time>
    </li>
    <li class="to">
      <span class="text">This is just a draft for a Windows 8 messaging app. Nothing special but I like the asthetics of the Metro UI. (Last edited 2013)</span>
      <time class="sent-time">13:37</time>
    </li>
  </ul>
  <div id="form">
    <div id="send-item"><span></span></div>
    <div id="send-smile"><span></span></div>
    <form id="message" >
    <input type="text" placeholder="Type Message">
    </form>
    <button id="send-message">Send</button>
  </div>
</div>

              
            
!

CSS

              
                * {
  box-sizing:border-box;
}
img {
  background: #EEE;
}body,html {
   padding:0;
   margin:0;
}
body {
  font-family:Segoe UI, sans-serif;
}

#chat-list,
#contact-info{
  width:350px;
  background:#2980b9;
  color:#FFF;
  float:left;
}
#chat-list{
  padding-top:40px;
}
#contact-info{
  width:300px;
  background:#3498db;
}
#chat-list > ul {
  list-style-type:none;
  padding:0;
  margin:0;
}
#chat-list > ul > li {
  padding:10px 40px;
  cursor:pointer
}
#chat-list > ul > li:hover {
  background:#236B99;
}
#chat-list > ul > li:after {
  content:'';
  display:block;
  clear:both;
}
#the-contact {
  margin:0;
}
.contact-img {
  width:60px;
  height:60px;
  float:left;
  margin-right:10px;
}

.contact-name {
  display:block;
  line-height:26px;
}
.message-excerpt {
  color:#DDD;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  line-height:26px;
  height:26px;
  display:block;
}

#search {
  margin:0 40px 10px;
  width:270px;
  padding:5px;
  border:2px solid #000;
}

#media-gallery h2 {
  font-weight:200;
  margin:10px 20px 20px;
}

#media-gallery ul {
  list-style-type:none;
  padding:0;
  margin:0 0 0 20px;
}
#media-gallery ul li {
  width:83px;
  height:83px;
  float:left;
  margin:0 5px 5px 0;
}
#media-gallery ul img {
  width:83px;
  height:83px;
  display:block;
  cursor:pointer;
}
#media-gallery ul img:hover {
  outline:2px solid #000;
}
#media-gallery ul img:active {
  transform:scale(0.97);
}

#chat-messages {
  position:relative;
  margin-left:650px;
}

#form {
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
  background:#EEE;
  padding:0;
  height:60px;
}

#form #send-item,
#form #send-smile,
#form #message,
#form #send-message {
  position:absolute;
  left:0;
}
#form #send-item,
#form #send-smile {
  width:60px;
  height:60px;
  cursor:pointer;
}
#form #send-item:hover,
#form #send-smile:hover,
#form #send-message:hover {
  background-color:#CCC;
}
#form #send-item span,
#form #send-smile span {
  width:32px;
  height:32px;
  display:block;
  background:url(https://zhukov.github.io/webogram/img/icons/IconsetW_1x.png) center top;
  margin:14px 0 0 15px;
}
#form #send-item span {
  background-position:center -64px;
}
#form #send-smile {
  left:60px;
}
#form #message {
  left:125px;
  right:105px;
}
#form #message input {
  width:100%;
  padding:5px;
  border:2px solid #000;
  margin-top:15px;
}
#form #send-message {
  right:0;
  left:auto;
  border:0;
  background:0;
  height:60px;
  text-align:center;
  width:100px;
  font-size:18px;
  cursor:pointer;
}

#the-contact img {
  width:300px;
  height:300px;
}

#contact-meta #contact-name {
  display:block;
  font-weight:200;
  margin:0 20px 0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#contact-meta #lastseen {
  margin:0 20px 20px;
  font-size:13px;
  display:block;
  color:#DDD;
}
#single-messages {
  padding:40px;
  margin:0;
  list-style-type:none;
  position:absolute;
  width:100%;
  bottom:60px;
}
#single-messages li {
  background:#EEE;
  padding:10px;
  margin-bottom:10px;
  width:80%;
  float:left;
  position:relative;
  font-size:16px;
  line-height:21px;
}
#single-messages li.from {
  float:right;
  text-align:right;
  background:#2980b9;
  color:#FFF;
}
#single-messages .sent-time {
  font-size:13px;
  display:block;
  text-align:right;
  color:#777;
  line-height:21px;
}
#single-messages .from .sent-time {
  text-align:left;
  color:#DDD;
}

@media(max-width:1100px) {
  #chat-list {
    display:none;
  }
  #chat-messages {
    margin-left:300px;
  }
}
@media(max-width:700px) {
  #media-gallery {
    display:none;
  }
  #contact-info{
    height: 60px !important;
    width: 100%;
    position:relative;
    z-index:10;
  }
  #contact-meta {
    position:absolute;
    left:60px;
    right:0;
  }
  #the-contact #contact-img {
    width:60px;
    height:60px;
    float:left;
  }
  #contact-name {
    line-height:35px;
    margin-left:10px !important;
  }
  #lastseen {
    margin-left:10px !important;
  }
  #chat-messages {
    margin-left:0;
    min-width:350px;
  }
}
              
            
!

JS

              
                $(document).ready(function() {
  bodyHeight = $(window).height();
  $('#chat-list, #whole-chat,#contact-info, #chat-messages').css('height',bodyHeight);
});
$(window).resize(function() {
  bodyHeight = $(window).height();
  $('#chat-list, #whole-chat, #contact-info, #chat-messages').css('height',bodyHeight);
});
              
            
!
999px

Console