So I want to set a div's width by the length of the heading, w/o specifying any widths or using jQuery.
<div>
<h1>Title here</h1>
<p>Long paragraph that needs to fit in the titles width. Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam.</p>
</div>
So I want to set a div's width by the length of the heading, w/o specifying any widths or using jQuery.
I thought I had it! - http://codepen.io/seanjacob/pen/xKfan but only works in FF :(
Without JS I'm pretty sure it isn't going to happen.
Ouch, sad since I got so close, there must be a CSS way of doing this.
That's what they all say.
If the h1 is floated it becomes only as wide as the text...
http://codepen.io/chriscoyier/pen/6744cc65c7a38aa97b3f12a19c5e8442
True but that won't set the width of the parent div or sibling paragraph will it?