Give help. Get help.

  • # November 28, 2012 at 10:50 am

    So I want to set a div’s width by the length of the heading, w/o specifying any widths or using jQuery.

    Title here

    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! – []( “codepen”) but only works in FF :(

    # November 28, 2012 at 11:05 am

    Without JS I’m pretty sure it isn’t going to happen.

    # November 28, 2012 at 11:10 am

    Ouch, sad since I got so close, there must be a CSS way of doing this.

    # November 28, 2012 at 11:11 am

    >there must be a CSS way of doing this

    That’s what they all say.

    # November 28, 2012 at 12:10 pm

    If the h1 is floated it becomes only as wide as the text…

    # November 28, 2012 at 12:29 pm

    True but that won’t set the width of the parent div or sibling paragraph will it?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.