To explain my problem, I\'m trying to make a div wide enough to accommodate a dynamically generated title without wrapping it, but the div also has other content, which I wa
Block elements such as divs extend as far as content pushes them, unless specified by explicit widths or heights.
A pure CSS solution for this is unlikely without setting a max-width on the div.
A pointer on CSS:
tag.class
) as you are then forced to use that tag with that class. Simply using .class
will make it easier to change your markup (should you need to) as well as make your class extend its use to more than a single tag.