JToland
JToland

Reputation: 3710

Placing Text Relative to Another Text

I have a CSS div which contains text (basically, it's a headline). I have another CSS div that I want to have smaller sized text and to sit right to the right of the first, larger-texted div. I'm not sure how to do this...how do I tell the second div to place itself against the right of the first when each instance of the first div could be various lengths? Is there anyway to do this so that the second, smaller-texted div would be butted up against the first and would be relative to the first's length?

Upvotes: 0

Views: 760

Answers (2)

Evan Mulawski
Evan Mulawski

Reputation: 55344

div.headline
{
    float:left;
}

div.details
{
    float:left;
}

div.clear
{
    clear:both;
}

Use in HTML:

<div class="heading">Heading</div>
<div class="details">Details</div>
<div class="clear"></div>

Hope this helps.

Upvotes: 1

marcgg
marcgg

Reputation: 66465

div{
  display:inline-block;
}

Upvotes: 1

Related Questions