问题1:20分
vs2008 asp.net 的 treeview 线条是断的
特别是竖向的长些的,一断一断的很难看
怎么解决,做不到像mztreeview的连续的么?
我知道有不带线的样式,但是我还是喜欢有线的样式, 但是线不连贯怎么解决?不想用mztreeview等js做的,用起来很麻烦啊,主要是对js很生,看了许多网页也没学会,还是内置的好啊
vs2008 asp.net 的 treeview 线条是断的
特别是竖向的长些的,一断一断的很难看
怎么解决,做不到像mztreeview的连续的么?
我知道有不带线的样式,但是我还是喜欢有线的样式, 但是线不连贯怎么解决?不想用mztreeview等js做的,用起来很麻烦啊,主要是对js很生,看了许多网页也没学会,还是内置的好啊
<style>
*{padding:0;margin:0;font-size:12px}
</style>
谢大侠回复
我是如下这样加的,请看红色部分,不好使,一定是加错了地方,应该加在什么地方?<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Tree.aspx.cs" Inherits="a_a" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<style type="text/css">
*{padding:0;margin:0;font-size:12px}
</style>
</head><body>
<form id="form1" runat="server">
<asp:TreeView ID="TreeView1" runat="server" LineImagesFolder="TreeLineImages"
ShowLines="True" ImageSet="Simple"
onselectednodechanged="TreeView1_SelectedNodeChanged">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD"
HorizontalPadding="0px" VerticalPadding="0px" />
<Nodes>
<asp:TreeNode Text="学校各部门" Value="学校各部门">
<asp:TreeNode Text="教务处" Value="教务处"></asp:TreeNode>
<asp:TreeNode Text="德育处" Value="德育处"></asp:TreeNode>
<asp:TreeNode Text="后勤" Value="后勤"></asp:TreeNode>
<asp:TreeNode Text="工会" Value="工会"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="学年" Value="学年">
<asp:TreeNode Text="高一" Value="高一"></asp:TreeNode>
<asp:TreeNode Text="高二" Value="高二"></asp:TreeNode>
<asp:TreeNode Text="高三" Value="高三"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
<NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black"
HorizontalPadding="0px" NodeSpacing="0px" VerticalPadding="0px" />
</asp:TreeView>
</form>
</body></html>
我已改如下,里面没有10pt了:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Tree.aspx.cs" Inherits="a_a" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<style type="text/css">
*{padding:0;margin:0;font-size:12px}
</style>
</head><body>
<form id="form1" runat="server">
<asp:TreeView ID="TreeView1" runat="server" LineImagesFolder="TreeLineImages"
ShowLines="True" ImageSet="Simple"
onselectednodechanged="TreeView1_SelectedNodeChanged">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD"
HorizontalPadding="0px" VerticalPadding="0px" />
<Nodes>
<asp:TreeNode Text="学校各部门" Value="学校各部门">
<asp:TreeNode Text="教务处" Value="教务处"></asp:TreeNode>
<asp:TreeNode Text="德育处" Value="德育处"></asp:TreeNode>
<asp:TreeNode Text="后勤" Value="后勤"></asp:TreeNode>
<asp:TreeNode Text="工会" Value="工会"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="学年" Value="学年">
<asp:TreeNode Text="高一" Value="高一"></asp:TreeNode>
<asp:TreeNode Text="高二" Value="高二"></asp:TreeNode>
<asp:TreeNode Text="高三" Value="高三"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
<NodeStyle Font-Names="Tahoma" ForeColor="Black"
HorizontalPadding="0px" NodeSpacing="0px" VerticalPadding="0px" />
</asp:TreeView>
</form>
</body></html>
<head>
<title></title>
<style type="text/css">
.tree td div
{
height: 20px !important;
}
*
{
padding: 0;
margin: 0;
border: 0;
}
</style>
</head>
<body>
<form id="form1" runat="server" style="margin: 0px; padding: 0px;">
<asp:TreeView ID="TreeView1" runat="server" ShowLines="True" CssClass="tree">
<Nodes>
<asp:TreeNode Text="新建节点" Value="新建节点"></asp:TreeNode>
<asp:TreeNode Text="新建节点" Value="新建节点">
<asp:TreeNode Text="新建节点" Value="新建节点">
<asp:TreeNode Text="新建节点" Value="新建节点">
<asp:TreeNode Text="新建节点" Value="新建节点"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="新建节点" Value="新建节点"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="新建节点" Value="新建节点"></asp:TreeNode>
<asp:TreeNode Text="新建节点" Value="新建节点">
<asp:TreeNode Text="新建节点" Value="新建节点">
<asp:TreeNode Text="新建节点" Value="新建节点">
<asp:TreeNode Text="新建节点" Value="新建节点"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="新建节点" Value="新建节点">
<asp:TreeNode Text="新建节点" Value="新建节点"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</form>
</body>
</html>