Nitish
Nitish

Reputation: 2763

Inline display for div within div

I have a HTML page with structure like below:

<div id="frst">
FIRST
</div>
<div id="top">
    <div id="mid">
        <div id="bottom">
            <ul class="menu">
                <li>A</li>
                <li>A</li>
                <li>A</li>
            </ul>    
        </div>
    </div>
</div>   

And the CSS I have wrote :

#frst{
display:inline;
}
#top,#mid,#bottom{
display:inline;
}
.menu li
{
    display:inline;
}

I want to display the divs with id first and top inline. But its displaying top div below the div first ! How can I make them inline ?

Upvotes: 0

Views: 49

Answers (1)

Dhaval Marthak
Dhaval Marthak

Reputation: 17366

Try with this:

use display:inline-block;

#top{
  display:inline-block;
}

Example

Upvotes: 2

Related Questions