父div之外的文本溢出

时间:2011-12-24 16:26:46

标签: javascript jquery jstree

我无法理解如何避免文本溢出,如下所示: enter image description here

我的标记:

<div class="sidebar">
                <div class="well">
                    <span class="folders_icons">
                        <a id="add_folder" name="add_folder">
                        <img src= "Images/Browser/add.JPG" title="add folder" /></a>
                        <a id="remove_folder" name="remove_folder">
                        <img src="Images/Browser/delete.JPG" title="remove folder" /></a>
                        <a id="rename_folder" name="rename_folder">
                        <img src="Images/Browser/rename.JPG" title="rename folder" /></a>
                    </span>
                    <h5>My Folders</h5>
                    <div id="jstree"></div>
                </div>
            </div>

1 个答案:

答案 0 :(得分:4)

您可以使用text-overflow css属性。

#jstree {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}