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

              
                <body ng-app="CopyDemo" ng-controller="formInput">
  <div class="row" id="container">
    <div class="small-12 columns">
      <form name="demo">
        <div class="row">
          <div class="small-6 columns">
            <label>
              <b>Sender Name</b>
              <input ng-model="input.brand" type="text" />
            </label>
            <label>
              <b>Subject Line:</b> <span ng-class="{'good':input.subjectLine.length <= 40, 'warning':input.subjectLine.length > 40, 'bad':input.subjectLine.length > 60 }">{{ input.subjectLine.length}}</span>
              <input ng-model="input.subjectLine" type="text" />
            </label>
            <label>
              <b>Preheader:</b> <span ng-class="{'good':input.preheader.length <= 50, 'warning':input.preheader.length > 50, 'bad':input.preheader.length > 80 }"> {{ input.preheader.length}}</span>
              <input ng-model="input.preheader" type="text" />
            </label>
          </div>
          <div class="small-6 columns">
            <label>
              <b>Follow up text</b>
              <textarea rows="10" ng-model="input.followupText"></textarea>
            </label>
          </div>
        </div>
      </form>
    </div>
  </div>
  <div class="row">
    <div class="small-12 columns">
      <div class="gmailTable">
        <div class="gmailRow">
          <div class="checkbox">
            <div></div>
          </div>
          <div class="star">
            <img src="https://ssl.gstatic.com/ui/v1/star/star4.png" />
          </div>
          <div class="senderName">{{input.brand}}</div>
          <div class="subjectLineAndPreHeader">
            <div>
              <span class="SL">{{input.subjectLine}}</span>
              <span class="pre">- {{input.preheader}} {{input.followupText}}</span>
            </div>
          </div>
          <div class="time">
            <div>10:00 am</div>
          </div>
          <div class="clear"></div>
        </div>
      </div>
    </div>
  </div>
  <div class="row space">
    <div class="small-12 columns">
      <input type="checkbox" name="checkbox" id="checkbox" />
      <label class="iPhoneCheckbox" for="checkbox" data-off="iPhone" data-on="iPad"></label>
      <div class="iphone ios" style="margin-top:20px;">
        <div class="speaker"></div>
        <div class="screen">
          <div class="navigationController">
            <div class="back">
              <div>‹</div>&nbsp;&nbsp;&nbsp;&nbsp;Back</div>
            <div class="title">Inbox</div>
            <div class="edit">Edit</div>
          </div>
          <div class="searchBar">
            <div>Search</div>
          </div>
          <div class="tableRow">
            <div class="newEmailIcon"></div>
            <div class="sender">{{input.brand}}</div>
            <div class="timeiPhone">10:00 AM ›</div>
            <div class="titleiPhone">{{input.subjectLine}}</div>
            <div class="preheader" data-ng-bind="input.preheader+ ' ' + input.followupText" data-ellipsis>
              <span>
                {{input.preheader}} {{input.followupText}}
              </span>
            </div>
          </div>
        </div>
        <button></button>
      </div>
    </div>
  </div>
  <div class="litmusLogo">
    <a href="https://litmus.com/">
      <img src="https://i.imgur.com/7GTLNyI.png" />
    </a>
  </div>
</body>
              
            
!

CSS

              
                html,
body {
  font-family: arial, sans-serif;
  min-width: 720px;
  overflow: hidden;
}

.checkbox,
.star,
.senderName,
.subjectLineAndPreHeader {
  float: left;
  display: block;
  position: relative;
}

.row {
  max-width: 1500px;
}

#container {
  margin-top: 40px;
}

.gmailRow {
  background: rgba(243, 243, 243, .85);
  padding: 6px 0px 6px 0px;
}

.gmailTable {
  border-top: 1px #e5e5e5 solid;
  border-left: transparent;
  border-right: transparent;
  border-bottom: 1px #e5e5e5 solid;
  margin-top: 30px;
  padding: 0;
}

.checkbox {
  padding-left: 20px!important;
  padding-right: 10px!important;
  padding-top: 4px;
  vertical-align: top;
  width: 45px;
}

.checkbox div {
  -webkit-border-radius: 0;
  border-radius: 0;
  background-color: rgba(255, 255, 255, .75);
  border: 1px solid #c6c6c6;
  border: 1px solid rgba(155, 155, 155, .57);
  font-size: 1px;
  height: 15px;
  margin: 0 auto;
  outline: 0;
  vertical-align: text-bottom;
  width: 15px;
}

.star img {
  max-width: 20px;
  min-width: 20px;
  margin-bottom: 3px;
}

.star {
  width: 25px;
}

.senderName {
  padding-right: 6px!important;
  padding-left: 4px!important;
  width: 200px;
  font-weight: bold;
}

.subjectLineAndPreHeader {
  overflow: visible;
  width: 100%;
  max-width: 70%;
  vertical-align: top;
}

.subjectLineAndPreHeader div {
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
}

.SL {
  font-weight: bold;
  max-width:550px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display:inline-block;
  vertical-align:top;
}

.pre {
  color: #777;
}

.time {
  font-weight: bold;
  padding-right: 20px!important;
  padding-left: 0px!important;
  text-align: right;
  position: absolute;
  background: rgba(243, 243, 243, 1);
  width: 120px;
  right: 15px;
}

.time div {}

.clear {
  clear: both;
}
/* iPhone/iPad Styles */

*,
*:before {
  transition: all .5s ease;
}

.space {
  margin-top: 20px;
  border-top: 1px solid #ebebeb;
}

.ios {
  position: relative;
  background-color: #f9f9f9;
  width: 320px;
  height: 620px;
  margin: 0 auto;
  border-radius: 24px;
  border: 1.6px solid #dddddd;
  box-shadow: 0 0 0.4em rgba(0, 0, 0, 0.1);
}

.ios .screen {
  padding: 20% 5%;
  width: 100%;
  height: 100%;
  border: 0;
  position: absolute;
  top: 0;
}

.ios .screen:before {
  content: "";
  background-color: #fffffe;
  width: 100%;
  height: 100%;
  display: block;
  border: 2px solid #000;
}

.ios .speaker {
  position: relative;
  width: 15%;
  margin: 10% auto 7% auto;
  height: 4px;
  background-color: #555;
  border-radius: 10px;
}

.ios .speaker:before {
  content: "";
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  left: -15px;
  top: -2px;
  background-color: #777;
}

.ios button {
  position: absolute;
  left: 50%;
  bottom: 2.6%;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 2.4px solid #dddddd;
  margin-left: -17.5px;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  background-color: #f9f9f9;
}

input[type=checkbox]:checked ~ .ios {
  width: 765px;
  height: 1024px;
  border-width: 3px;
}

input[type=checkbox]:checked ~ .ios .screen {
  padding: 9% 5%;
}

input[type=checkbox]:checked ~ .ios .speaker {
  width: 0%;
  margin: 4.2% auto 7% auto;
}

input[type=checkbox]:checked ~ .ios .speaker:before {
  left: 1px;
}

input[type=checkbox],
input[type=checkbox]:active {
  position: absolute;
  top: -5000px;
  height: 0;
  width: 0;
  opacity: 0;
  border: none;
  outline: none;
}

.iPhoneCheckbox {
  display: block;
  position: relative;
  padding: 10px;
  margin: 10px 50px;
  font-size: 12px;
  line-height: 16px;
  width: 72px;
  height: 38px;
  border-radius: 18px;
  border: 1px solid #ddd;
  background: #eee;
  cursor: pointer;
}

.iPhoneCheckbox:before {
  content: '';
  display: block;
  position: absolute;
  z-index: 1;
  line-height: 36px;
  height: 36px;
  width: 36px;
  border-radius: 50%;
  top: 0px;
  left: 0px;
  right: auto;
  background: #fff;
  box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
}

.iPhoneCheckbox:after {
  content: attr(data-off);
  font: normal 12px Helvetica, Arial, San-serif;
  display: block;
  position: absolute;
  top: 0;
  left: -55px;
  padding: 10px;
  height: 100%;
  width: 40px;
  color: #999;
  white-space: nowrap;
}

input[type=checkbox]:checked + label:before {
  left: calc(50%);
}

input[type=checkbox]:checked + label:after {
  content: attr(data-on);
  left: 70px;
}

input[type="checkbox"] + label,
input[type="radio"] + label {
  margin-left: 40px;
}
.navigationController {
  width:98.7%;
  background-color:#f2f2f2;
  height:40px;
  position:relative;
  top:-488px;
  left:2px;
  padding-top:7px;
}
.back {
  font-family:'Helvetica Neue';
  font-weight:300;
  color:#007AFF;
}
.back div{
  display:block;
  position:absolute;
  left:5px;
  top:-26px;
  font-size:55px;
  font-weight:100;
}
.title {
  font-family:'Helvetica Neue';
  font-weight:400;
  color:#4A4A4A;
  position:absolute;
  left:44%;
  top:16%;
}
.edit {
  font-family:'Helvetica Neue';
  font-weight:300;
  color:#007AFF;
  position:absolute;
  right:7px;
  top:16%;
}
.searchBar{
  width:98.7%;
  background-color:#C7C7CC;
  height:40px;
  position:relative;
  top:-488px;
  left:2px;
  padding-top:7px;
}
.searchBar div {
  width:96%;
  margin:0 auto;
  background:#fff;
  border-radius:5px;
  padding:4px;
  font-size:12px;
  text-align:center;
  color:#c7c7c7;
  font-family:'Helvetica Neue';
  font-weight:300;
  
}
.tableRow{
  width:92.5%;
  border-bottom:1px solid #c7c7c7;
  height:60px;
  position:relative;
  top:-468px;
  left:20px;
  padding-top:7px;
}
.newEmailIcon {
  background:#007AFF;
  width:10px;
  height:10px;
  border-radius:100%;
  position:absolute;
  left:-14px;
  top:-10px;
}
.sender {
  position:absolute;
  left:0px;
  top:-16px;
  font-weight:500;
  font-size:14px;
  font-family:'Helvetica Neue';
}
.timeiPhone {
  position:absolute;
  right:10px;
  top:-12px;
  font-weight:300;
  font-size:11px;
  color:#c7c7c7;
  font-family:'Helvetica Neue';
}
.titleiPhone {
  position:absolute;
  left:1px;
  top:3px;
  font-weight:300;
  width:255px;
  font-size:13.2px;
  font-family:'Helvetica Neue';
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preheader {
  position:absolute;
  overflow:hidden;
  right:7px;
  top:21px;
  font-weight:300;
  font-size:11px;
  color:#c7c7c7;
  font-family:'Helvetica Neue';
  width:255px;
  height:32px;
}
.good {
  background:#2ecc71;
  padding:4px 10px;
  color:#fffffe;
  border-radius:3px;
}
.warning {
  background:#f39c12;
  padding:4px 10px;
  color:#fffffe;
  border-radius:3px;
}
.bad {
  background:#e74c3c;
  padding:4px 10px;
  color:#fffffe;
  border-radius:3px;
}
@media only screen and (max-width:1100px) {
  .subjectLineAndPreHeader {
    width:61%;
  }
}
@media only screen and (max-width:725px) {
  .subjectLineAndPreHeader {
    width:60%;
  }
}
.litmusLogo {
  position:absolute;
  right:20px;
  bottom:20px;
  z-index;1000;
}
.litmusLogo img {
  width:125px;
}
              
            
!

JS

              
                (function(){
  var app = angular.module('CopyDemo', ['dibari.angular-ellipsis']);
  
  app.controller('formInput', ['$scope', function($scope){
    $scope.input = {
      brand: 'My Brand',
      subjectLine: 'Add Your Subject Line Here',
      preheader: 'Add your preheader here.',
      followupText: "Brand Name | Men's | Womens' | Best Sellers | New Arrivals"
    };
  }]);
})();
              
            
!
999px

Console