Blog信息 |
blog名称:注册会计师(注会)练习软件 日志总数:398 评论数量:116 留言数量:27 访问次数:3267131 建立时间:2005年6月6日 |

| |
[delpih编程]asp.net中repeater控件做横向菜单方便控制 软件技术
吕向阳 发表于 2009/3/14 11:34:19 |
列表作横向菜单的CSS,当然一般用'<div class="">'<ul>'<li><li>'<li><li>'<li><li>..'</ul>'</div>这样做是没有一点问题的,问题是我用的是一个asp.net中repeater控件来做的,常规做法出现的问题是不出现在一行上,并且高度不能控制。此时 我用下面方法解决
主要改变做法:去掉<ul><li>相关标签,改为:CssClass="li" (asp.net对象)或class="li"(html对象)============html代码:/*<div class="test"> (注:这里也没有用<ul></ul>) <a href="index.aspx" class="li">回主页</a> (注:这里没有用<li></li> <ASP:Repeater id="Repeater1" runat="server"> <itemtemplate> <asp:HyperLink CssClass="li" runat="server" navigateurl='<%# "typelist.aspx?RootId="+DataBinder.Eval(Container.DataItem ,"externalid") %>' target="_self"><%# DataBinder.Eval(Container.DataItem,"mc")%> </asp:HyperLink> </itemtemplate> </ASP:Repeater> <a href="newstypeadd.aspx" class="li">管理</a></div>
*/============css代码/*.test ul{list-style:none;width:100%;background:#CCC;height:25px;}.test li{float:left;width:100px;background:#CCC;margin-left:0px;line-height:25px;}
.test a{font-size: 14px;float:left;width:100px;display:block;text-align:center;height:30px;}.test a:link{font-size: 14px;float:left;width:100px;color:#666;background:url(images\arrow_off.gif) #CCC no-repeat 5px 12px;text-decoration:none;}.test a:visited{font-size: 14px;float:left;width:100px;color:#666;text-decoration:underline;}.test a:hover{font-size: 14px;float:left;width:100px;color:#FFF; font-weight:bold;text-decoration:none;background:url(images\arrow_on.gif) #F00 no-repeat 5px 12px;}.test a:active{font-size: 14px;float:left;width:100px;color:#FFF; font-weight:bold;text-decoration:none;background:url(images\arrow_on.gif) #F00 no-repeat 5px 12px;}*/======== |
|
|