I have an unordered list where each list item will contain 2 divs. I want the divs to float next to each other, while still having the list items stack vertically. The issue is that all my divs are floating instead of each list item going beneath the previous one. What style changes do I need to make here?
Thanks!
// Add the message to the page.
$('#conversation').append('<li><div class="chat-container"><div class="' + cssStyle + '"></div><div class="chat-text"><strong>' + encodedName + '</strong>: ' + encodedMsg + '</div><div></li>');
My Styles:
#conversation >li > div > div {
float: left;
}
.legend {
font-size: 20px;
}
.chat-text {
padding-left: 20px;
}
With the answer I now achieve the desired result.