Instead of using display: inline
, opt for display: inline-block
in your CSS code:
.latest-tweets ul li p,
.latest-tweets ul li:before {
display: inline-block;
vertical-align: top;
}
If you have an inline element followed by a block-level element, the latter will start on a new line. To keep them on the same line, make both elements inline-block
.
.latest-tweets ul li:before {
content: url("https://s27.postimg.org/419bicyab/home_tweeter_icon.jpg");
display: inline-block;
vertical-align: top;
}
.latest-tweets ul li {
background: none;
list-style:none;
}
.latest-tweets ul li p {
display: inline-block;
vertical-align: top;
max-width: 85%;
}
<div class="latest-tweets">
<ul>
<li>
<p class="tweet-text">This is tweet Text</p>
</li>
</ul>
</div>
Note: Apply a max-width
to p
so it remains contained when lots of text is added.