<div class="box">
<p class="text">
<div class="icon"></div>
</div>
.box {
width: 175px;
}
.icon {
display: inline-block;
width: 20px;
height: 20px;
background: red;
}
expected effect: if the text is not long enough and no overflow is needed, the .icon
element immediately follows the text; if the text is too long, the .icon
element does not wrap. The .
element does not wrap.
needs to be compatible with ie9, for great answers