我有一个设置了固定宽度的 asp.net TreeView 控件,但是即使我在节点上指定了宽度,我的节点文本也会超出控件的边缘:
<style type="text/css">
.treeNode {
color:red;
font: 14px Arial, Sans-Serif;
width:30px;
}
.rootNode {
font-size: 18px;
color:blue;
width:30px;
}
.leafNode {
padding: 4px;
color:orange;
width:30px;
}
.selectNode {
font-weight: bold;
color:purple;
}
</style>
<asp:TreeView ID="tvData" runat="server" ShowLines="True" Width="100" BorderStyle="Solid">
<LeafNodeStyle CssClass="leafNode" />
<NodeStyle CssClass="treeNode" />
<RootNodeStyle CssClass="rootNode" />
<SelectedNodeStyle CssClass="selectNode" />
<Nodes>
<asp:TreeNode Text="Root" Value="0">
<asp:TreeNode Text="Products Products Products">
<asp:TreeNode Text="First Product" />
<asp:TreeNode Text="Second Product Second Product Second Product" />
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
我想停止在控件边界之外运行的文本,但我不想将它换行到另一行。