开发者

How to word wrap <ul><li><div><a></a></div></li></ul>

How would I be able to have word wrap when text in &开发者_JAVA技巧lt;a> is way too long? I want the <li> to expand to the word wrap using CSS.


Are you looking for the word-wrap property?

<ul>
    <li>
        <div style="word-wrap: break-word;">
            <a></a>
        </div>
    </li>
</ul>


Not exactly sure what you're after here, but the CSS3 text-wrap or word-wrap might do it.

You could also try setting a width on the <li>. That would force the text inside it to a certain width.

Finally, if the text does not contain spaces/wrappable chars, perhaps <wbr> might work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜