I want to display dtan HTML tag side by side, and not one below the other For example: -
dt
<dl class='Desktop'> <dt class='first'>first</dt> <dt class='Second'>second</dt> <dt class='third'>third</dt> </dl>
Output: first second third
first
second
third
I like all the other answers as they are good, but I think mine is much simpler and does not require IE hacks:
dt { display: inline; }
dl.Desktop dt{float:left;}
Get them side by side. Here is an example: http://jsfiddle.net/zD8bs/ .
Note: Additional style may be required to work properly.
You can either make them float to the left:
dt { float: left; }
Or make them an inline block:
dt { display: inline-block; zoom: 1; /* IE hack */ *display: inline; /* IE hack */ }
Why an inline unit may be desirable .