gespinha
gespinha

Reputation: 8497

How to make absolute div assume content's width?

I've got the following peace of code - http://jsfiddle.net/QkYvs/2/

    <div id="parent">
        <div id="childOne">
            <div id="childTwo"></div>
        </div>
    </div>

#childTwo is wrapping its text to the #parent width. How can I make #childTwo's width to be its content's width?

Upvotes: 9

Views: 7354

Answers (1)

Justin Lessard
Justin Lessard

Reputation: 11981

white-space:nowrap;

See this fiddle.

Upvotes: 25

Related Questions