Page Widget How to - Float text in same line








Question

We would like to know how to float text in same line.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.cell {<!-- w  w w .  j  a v a 2  s .  co  m-->
  width: 19%;
}
</style>
</head>
<body>
  <div style="width: 100%">
    <div class="cell" style="float: left; min-width: 30px; padding: 4px">Text
      1</div>
    <div class="cell" style="float: left; min-width: 30px; padding: 4px">Text
      2</div>
    <div class="cell" style="float: left; min-width: 30px; padding: 4px">Text
      3</div>
    <div class="cell" style="float: left; min-width: 30px; padding: 4px">Text
      4</div>
    <div class="cell" style="float: left; min-width: 30px; padding: 4px">Text
      5</div>
  </div>
</body>
</html>

The code above is rendered as follows: