- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
So I want to set a div’s width by the length of the heading, w/o specifying any widths or using jQuery.
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.
I thought I had it! – [http://codepen.io/seanjacob/pen/xKfan](http://codepen.io/seanjacob/pen/xKfan “codepen”) 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.
>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?