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 class="wrapper">
  <div class="card">
    <div class="card__avatar">
      <svg role="none" style="height: 56px; width: 56px">
        <mask id="circle">
          <circle cx="28" cy="28" fill="white" r="28"></circle>
          <circle cx="48" cy="48" fill="black" r="7"></circle>
        </mask>
        <g mask="url(#circle)">
          <image x="0" y="0" height="100%" preserveAspectRatio="xMidYMid slice" width="100%" xlink:href="https://via.placeholder.com/60" style="height: 56px; width: 56px"></image>
          <circle class="border" cx="28" cy="28" r="28"></circle>
        </g>
      </svg>
      <div class="badge"></div>
    </div>
    <div>
      <h3>Ahmad Shadeed</h3>
      <p>You: Thanks, sounds good! . 8hr</p>
      <img class="card__seen" src="https://via.placeholder.com/60" alt="" />
    </div>
  </div>

  <div class="card is-dark">
    <div class="card__avatar sol-1">
      <img src="https://via.placeholder.com/60" alt="" />
      <div class="border"></div>
      <div class="badge"></div>
    </div>
    <div>
      <h3>Ahmad Shadeed</h3>
      <p>You: Thanks, sounds good! . 8hr</p>
      <img class="card__seen" src="https://via.placeholder.com/60" alt="" />
    </div>
  </div>

  <div class="card is-dark">
    <div class="card__avatar">
      <svg role="none" style="height: 56px; width: 56px">
        <mask id="circle">
          <circle cx="28" cy="28" fill="white" r="28"></circle>
          <circle cx="48" cy="48" fill="black" r="7"></circle>
        </mask>
        <g mask="url(#circle)">
          <image x="0" y="0" height="100%" preserveAspectRatio="xMidYMid slice" width="100%" xlink:href="https://via.placeholder.com/60" style="height: 56px; width: 56px"></image>
          <circle class="border" cx="28" cy="28" r="28"></circle>
        </g>
      </svg>
      <div class="badge"></div>
    </div>
    <div>
      <h3>Ahmad Shadeed</h3>
      <p>You: Thanks, sounds good! . 8hr</p>
      <img class="card__seen" src="https://via.placeholder.com/60" alt="" />
    </div>
  </div>

  <div class="card">
    <div class="card__avatar card__avatar--multiple">
      <svg class="avatar-1" role="none" style="height: 36px; width: 36px">
        <mask id="circle1">
          <circle cx="18" cy="18" fill="white" r="18"></circle>
        </mask>
        <g mask="url(#circle1)">
          <image x="0" y="0" height="100%" preserveAspectRatio="xMidYMid slice" width="100%" xlink:href="https://via.placeholder.com/60" style="height: 36px; width: 36px"></image>
          <circle class="border" cx="18" cy="18" r="18"></circle>
        </g>
      </svg>
      <svg class="avatar-2" role="none" style="height: 36px; width: 36px">
        <mask id="circle2">
          <circle cx="18" cy="18" fill="white" r="18"></circle>
        </mask>
        <g mask="url(#circle2)">
          <image x="0" y="0" height="100%" preserveAspectRatio="xMidYMid slice" width="100%" xlink:href="https://via.placeholder.com/60" style="height: 36px; width: 36px"></image>
          <circle class="border" cx="18" cy="18" r="18"></circle>
        </g>
      </svg>
      <div class="badge"></div>
    </div>
    <div>
      <h3>Ahmad Shadeed</h3>
      <p>You: Thanks, sounds good! . 8hr</p>
      <img class="card__seen" src="https://via.placeholder.com/60" alt="" />
    </div>
  </div>

  <div class="card">
    <div class="card__avatar">
      <svg role="none" style="height: 56px; width: 56px">
        <mask id="circle">
          <circle cx="28" cy="28" fill="white" r="28"></circle>
          <circle cx="48" cy="48" fill="black" r="7"></circle>
        </mask>
        <g mask="url(#circle)">
          <image x="0" y="0" height="100%" preserveAspectRatio="xMidYMid slice" width="100%" xlink:href="https://via.placeholder.com/60" style="height: 56px; width: 56px"></image>
          <circle class="border" cx="28" cy="28" r="28"></circle>
        </g>
      </svg>
      <div class="badge"></div>
    </div>
    <div class="card__content">
      <div class="card__content__start">
        <h3>Ahmad Shadeed</h3>
        <div>
          <p>You: Thanks, sounds good. What about doing a webinar, too?</p>
          <span class="separator">.</span><time style="font-size: 13px">8hr</time>
        </div>
      </div>
      <div class="card__content__end">
        <div class="new"></div>
        <div role="button" aria-label="Mark as read" tabindex="0"></div>
      </div>
    </div>
  </div>

  <div role="grid">
    <div role="row">
      <div role="gridcell">
        <a href="#">
          <!-- The component lives here -->
        </a>
      </div>
    </div>
    <div role="row">
      <div role="gridcell">
        <a href="#">
          <!-- The component lives here -->
        </a>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                .wrapper {
  max-width: 344px;
  margin: 2rem auto;
}

.card {
  --primary-text: #050505;
  --secondary-text: #65676b;
  --bg-color: #fff;

  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  padding: 8px 12px 8px 8px;
  border-radius: 7px;
  box-shadow: 0 3px 15px 0 rgba(#000, 0.05);

  h3 {
    color: var(--primary-text);
    font-size: 15px;
  }

  p,
  time,
  .separator {
    font-size: 13px;
    color: var(--secondary-text);
  }

  &.is-dark {
    --primary-text: #e4e6eb;
    --secondary-text: #b0b3b8;
    --bg-color: #242526;
  }

  & + & {
    margin-top: 1rem;
  }
}

.card__avatar {
  position: relative;
  display: flex;
  margin-right: 12px;
  //outline: solid 1px grey;

  .badge {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 10px;
    height: 10px;
    background: #5ad539;
    border-radius: 50%;
  }
}

.card__avatar--multiple {
  display: block;
  width: 56px;
  height: 56px;
  position: relative;
  //outline: solid 1px grey;

  .avatar-1 {
    position: absolute;
    right: 0;
    top: 0;
  }

  .avatar-2 {
    position: absolute;
    left: 0;
    bottom: 0;
  }

  .badge {
    right: 6px;
    bottom: 6px;
  }

  .border {
    stroke-width: 2;
  }
}

.card__avatar--multiple-2 {
  display: grid;
  outline: solid 1px;

  svg:nth-of-type(1) {
    grid-area: 1 / 1 / 2 / 2;
  }

  svg:nth-of-type(2) {
    grid-area: 1 / 2 / 2 / 3;
  }
}

.card__avatar.sol-1 {
  position: relative;
  img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
  }

  .border {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 2px solid #000;
    border-radius: 50%;
    opacity: 0.1;
  }

  .badge {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
  }
}

.border {
  stroke-width: 3;
  stroke: rgba(0, 0, 0, 0.1);
  fill: none;
}

.card__seen {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.new {
  display: inline-flex;
  width: 12px;
  height: 12px;
  background-color: #009aff;
  border-radius: 50%;
  cursor: pointer;
}

.card__content {
  display: flex;
  flex: 1;
  min-width: 0;
}

.card__content__start {
  flex: 1;
  outline-offset: 2px;
  min-width: 0;

  > div {
    display: flex;
    align-items: center;
  }

  h3,
  p {
    overflow-x: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

.separator {
  margin: 0 4px;
}

.card__content__end {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 12px;
}

body {
  font-family: "Helvetica";
  line-height: 1.4;
  padding: 1rem;
  background-color: #f7f7f7;
}

* {
  box-sizing: border-box;
}

              
            
!

JS

              
                
              
            
!
999px

Console