<p class="info warning">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec erat nec odio consequat lacinia nec id leo. Morbi nec malesuada ante. Maecenas consequat pretium dolor a sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Pellentesque urna mauris, dapibus vel viverra ac, ultrices in tellus. Donec sit amet dolor vel velit varius pulvinar in sed massa. Duis feugiat nunc non risus gravida imperdiet. Praesent justo dolor, luctus id viverra eget, gravida vitae velit. Proin bibendum venenatis porttitor. Morbi auctor libero nec tellus pharetra vulputate. Duis lobortis sagittis est porta venenatis.
</p><p class="info">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec erat nec odio consequat lacinia nec id leo. Morbi nec malesuada ante. Maecenas consequat pretium dolor a sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Pellentesque urna mauris, dapibus vel viverra ac, ultrices in tellus. Donec sit amet dolor vel velit varius pulvinar in sed massa. Duis feugiat nunc non risus gravida imperdiet. Praesent justo dolor, luctus id viverra eget, gravida vitae velit. Proin bibendum venenatis porttitor. Morbi auctor libero nec tellus pharetra vulputate. Duis lobortis sagittis est porta venenatis.
</p>
@import "compass/css3";

/*
The MIT License (MIT)
Copyright (c) 2013 Aaron Huang <github.com/aar0nTw>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

$blue:#33A6B8;
$dark-blue:#2B5F75;
$light-blue:#A5DEE4;

$red:#DB4D6D;
$dark-red:#9F353A;
$light-red:#F4A7B9;
$info-content: "Info";
$warning-content: "Warning";
$block-padding: 2em 2em 1em;

p.info {
  position: relative;
  background: $light-blue;
  padding: $block-padding;
  margin: 24px;
  font-size:16pt;
  &:before {
      content: $info-content;
      color: #fff;
      background: $blue;
      display: block;
      position: absolute;
      top: -9px;
      left: -18px;
      padding: 9px 18px 9px;
  }
  &:after{
      content: " ";
      display: block;
      position: absolute;
      border: 9px solid transparent;
      border-top-color: $dark-blue;
      border-right-color: $dark-blue;
      top: 33px;
      left: -18px;
  }
    
  &.warning {
      background: $light-red;
      &:before {
          content: $warning-content;
          background: $red;
      }
      &:after{
          border-top-color: $dark-red;
          border-right-color: $dark-red;
      }
  }
}

View Compiled
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.