0

i have an asp.net web application . in a view i have this problem: i need to adjust the content of an element .node

demo

i'd like to display the content of the node inside it.if the number of characters is big i'd like to display only the characters inside the node and delete the others characters displayed outside the node.

<style
.node{



}
</style>

So how can modify the style of the class node to do this task?

4

3 回答 3

1

你也可以试试text-overflow

.node{
text-overflow: clip; 
}

此属性剪辑文本

于 2013-11-06T14:46:56.517 回答
1

你可以试试

.node{
  overflow: hidden;
}

或者

.node{
  text-overflow:ellipsis;
}
于 2013-11-06T14:45:34.830 回答
0

计算节点内容的长度后,在 html 中使用内联样式。

<%
//in your script
//get length of the node's label
//set a variable with specific style / class
%>

<div class="node" style="<% the specific style %>"><% //content %></div>

甚至使用不同的类...

 <div class="<% the specific by size class %>"><% //content %></div>
于 2013-11-06T14:49:43.747 回答