Make Div as wide as it needs to be

后端 未结 5 612
我在风中等你
我在风中等你 2021-01-01 21:47

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

5条回答
  •  我在风中等你
    2021-01-01 22:37

    A working jQuery example:

    http://jsfiddle.net/8AFcv/

    $(function() {
        $(".box").width($(".title").width());
    })
    

提交回复
热议问题