JSFiddle - React, Tailwind, and code Playground

by madvofirst

HTML

<div class="wrapper">
    <ul id="messages">
          <li>
            <div class="received">
              1sadf
            </div>
          </li>
          <li>
            <div class="sent">
              1sadf
            </div>
          </li>
          <li>
            <div class="received">
              1sadf
            </div>
          </li>
          <li>
            <div class="sent">
              1sadf
            </div>
          </li>
      </ul>
  </div>

CSS

div {
  position: relative;
  padding: 4px 6px 4px 6px;
  line-height: 1.5;
  display:block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
}

.sent {
  color: white;
  background-color: #0181ff;
  float: right;
  border-radius: 0.5em 0.25em 0.0em 0.5em;
}

.received {
  color: black;
  background-color: #EEEEEE;
  float: left;
  border-radius: 0.5em 0.25em 0.25em 0.0em;
}

ul {
  list-style-type: none;
    padding-left: 0;
    border: 1px solid black;
    max-width: 300px;
    overflow: auto;
}

li {
  clear: both;
}