HTML Element Style How to - Turn div to inline








Question

We would like to know how to turn div to inline.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div.inline {<!--from w w  w. jav a 2 s. c  om-->
  display: inline;
}
</style>
</head>
<body>
  <div>
    <div class="inline">xx</div>
    <div class="inline">yy</div>
  </div>
  <div class="clear">zz</div>
</body>
</html>

The code above is rendered as follows: