Reputation: 143
i want make simple buble chat using css. with basic css (not CSS3) because the chat run on IE and loaded by VB program. i use float left and right, but i got issue like this pict
bubble left and right in a row. and what i want is like this pict
this is my sample code
<div style="width:600px;">
<div style="width:100%;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius</span>
</div>
<div style="width:100%;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
</div>
<div style="width:100%;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
</div>
<div style="width:100%;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
</div>
<div style="width:100%;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The </span>
</div>
<div style="width:100%;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius elements.</span>
</div>
</div>
Upvotes: 0
Views: 317
Reputation: 186
<div style="width:600px;">
<div style="display: block; width: 100%; float: left;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius</span>
</div>
<div style="display: block; width: 100%; float: right;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
</div>
<div style="display: block; width: 100%; float: right;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
</div>
<div style="display: block; width: 100%; float: left;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
</div>
<div style="display: block; width: 100%; float: right;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The </span>
</div>
<div style="display: block; width: 100%; float: left;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius elements.</span>
</div>
Upvotes: 1
Reputation: 1372
Try this code with clearfix:
<div style="width:600px;">
<div style="width:100%;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius</span>
<div style="clear: both"></div>
</div>
<div style="width:100%;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
<div style="clear: both"></div>
</div>
<div style="width:100%;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
<div style="clear: both"></div>
</div>
<div style="width:100%;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius property allows you to add rounded corners to elements.</span>
<div style="clear: both"></div>
</div>
<div style="width:100%;">
<span style="background:#ff4d4d;padding:10px;float:right;margin-top:5px;">The </span>
<div style="clear: both"></div>
</div>
<div style="width:100%;">
<span style="background:#e5e5e5;padding:10px;float:left;margin-top:5px;">The border-radius elements.</span>
<div style="clear: both"></div>
</div>
</div>
Upvotes: 2