HTML Element Style How to - Float dt and dd left








Question

We would like to know how to float dt and dd left.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
dt, dd {<!-- w  w  w .  j  a v a2s . c  o  m-->
  float: left;
}
</style>
</head>
<body>
  <dl>
    <dt>Coffee</dt>
    <dd>Black hot drink</dd>
    <dt>Milk</dt>
    <dd>White cold drink</dd>
  </dl>
</body>
</html>

The code above is rendered as follows: