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="comment2u">
  <div class="wrap">
    <div class="header">嘀咕 digu.plus (2)</div>
    <div class="body">
      <div class="item notice">
        "大佬"发布了《<a href="#">仿微信PC界面</a>》,访客可通过评论加入
      </div>
      <div class="item notice">"大佬"发起了群聊,访客可通过评论加入</div>
      <div class="item notice">"大佬"通过评论加入了群聊</div>
      <div class="item notice">2016-03-18 02:18:00</div>
      <div class="item parent">
        <div class="scope">
          <div class="nick">评论者</div>
          <div class="content">
            <span class="arrow"></span>
            <p>人生最好的三种状态:不期而遇、不言而喻、不药而愈。</p>
          </div>
        </div>
        <div class="avatar">
          <img src="https://cravatar.cn/avatar?d=monsterid&s=40" alt="" />
        </div>
      </div>
      <div class="item notice">2019-09-17 01:23:00</div>
      <div class="item child">
        <div class="avatar">
          <img src="https://cravatar.cn/avatar?d=monsterid&s=40" alt="" />
        </div>
        <div class="scope">
          <div class="nick">回复者</div>
          <div class="content">
            <span class="arrow"></span>
            <p>人生最好的三个词:久别重逢,失而复得,虚惊一场。</p>
          </div>
        </div>
      </div>
      <div class="item notice">
        你被"大佬"移出群聊,请在
        "<a target="_blank" href="https://digu.plus">这里</a>"
        进行投诉
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                #comment2u {
  font-size: 14px;
  margin: 0 auto;
  width: 720px;
  max-width: 100%;
  background-color: #eee;
  border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
}
#comment2u .wrap {
  padding: 10px 20px;
}
#comment2u .header {
  line-height: 30px;
  position: relative;
  padding-bottom: 10px;
  border-bottom: 1px solid #d6d6d6;
  background-color: #eee;
  text-align: center;
  margin-bottom: 12px;
}
#comment2u .body {
  min-height: 600px;
}

#comment2u .notice {
  max-width: 50%;
  text-align: center;
  font-size: 12px;
  margin: 0 auto;
  padding: 1px 18px;
  color: #b2b2b2;
  line-height: 24px;
}
#comment2u .notice a {
  color: #526685;
  text-decoration: none;
}
#comment2u .item {
  display: flex;
  margin-bottom: 12px;
}
#comment2u .notice {
  justify-content: center;
}
#comment2u .parent {
  justify-content: flex-end;
}
#comment2u .child {
  justify-content: flex-start;
}
#comment2u .parent .content {
  background-color: #b2e281;
}
#comment2u .child .content {
  background-color: #ffffff;
}
#comment2u .item .avatar img {
  width: 40px;
  height: 40px;
  border-radius: 2px;
  -moz-border-radius: 2px;
  -webkit-border-radius: 2px;
  cursor: pointer;
}
#comment2u .child .nick {
  padding-left: 10px;
  font-size: 12px;
  height: 24px;
  color: #4f4f4f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-wrap: normal;
}
#comment2u .parent .nick {
  text-align: right;
  padding-right: 10px;
  font-size: 12px;
  height: 24px;
  color: #4f4f4f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-wrap: normal;
}
#comment2u .item .content {
  word-wrap: break-word;
  word-break: break-all;
  min-height: 25px;
  max-width: 500px;
  min-height: 1em;
  font-size: 14px;
  border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  margin: 0 10px;
  text-align: left;
  position: relative;
  padding: 10px 15px;
}
#comment2u .parent .arrow {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid;
  border-left-color: #b2e281;
  border-right: 0;
  border-right-color: transparent;
  right: -6px;
  left: auto;
  top: 12px;
  position: absolute;
}
#comment2u .child .arrow {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid;
  border-right-color: #ffffff;
  border-left: 0;
  border-left-color: transparent;
  right: auto;
  left: -6px;
  top: 12px;
  position: absolute;
}
#comment2u .item .content p {
  margin: 0;
  line-height: 1.6;
}
              
            
!

JS

              
                
              
            
!
999px

Console