Kris Kris - 1 year ago 59
CSS Question

Making child elements of a div inline

I am looking for the CSS property to make elements inside a div inline.

What property do I need to add to the parent

to make the child elements

I don't want to apply a class directly to the children.

<div id="container">


Answer Source

Do you mean all the children? Then use

#container * {
   display: inline-block;

If you mean only the direct children (so not the elements nested in the children) use

#container > * {  
   display: inline-block;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download