I am currently compiling a list of messages sent and received on our chat platform. Here is the current layout:
However, I would like to revamp this structure to something like the following:
Take a look at the new preview here
I need guidance on how to update the design. Below are the CSS and HTML snippets I am working with:
ul {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 10px;
}
ul li {
padding: 5px 10px;
display: block;
color: white;
background: #444;
height: 30px;
list-style-type: none;
}
ul li.out {
background: cornflowerblue;
}
<ul>
<li class="out">1</li>
<li>2</li>
<li>3</li>
<li class="out">4</li>
<li class="out">5</li>
<li>6</li>
<li class="out">7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li class="out">11</li>
</ul>