Menu 选项卡样式调整

前台:

<style type="text/css">
        a
        {
            text-decoration: none;
            font-size: 13px;
            color: #666666;
        }
        a:hover
        {
            text-decoration: none;
            color: #666666;
        }
        .style1
        {
            width: 380px;
            color:#666666;
            font-size: 13px;
            font-family: 黑体;
        }
        .style3
        {
            width: 300px;
            height: 20px;
            color:#666666;
            font-size: 13px;
            font-family: 宋体;
        }
        .style4
        {
            width: 80px;
            height: 20px;
            color:#666666;
            font-size: 13px;
            font-family: 黑体;
        }
       
        .NewsTabMenu
        {
            background-image: url("../images/tab2off.gif");
            width: 95px;
            height: 27px;
            font-family: 黑体;
            color: #666666;
            font-size: 15px;
            font-weight: bold;
            line-height: 20px;
            text-decoration: none;
            text-align: center;
        }
        .selectedStyle
        {
            background-image: url("../images/tab2off.gif");
            width: 95px;
            height: 27px;
            font-family: 黑体;
            font-size: 15px;
            font-weight: bold;
            text-decoration: none;
            text-align: center;
        }
        .selectedStyle a,a:hover{text-decoration:none; color:#1A8A98;}
       
    </style>

 

                <div style="float: left;">
                    <asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal"
                        Width="320px">
                        <LevelMenuItemStyles>
                            <asp:MenuItemStyle CssClass="NewsTabMenu"/>
                        </LevelMenuItemStyles>
                        <LevelSelectedStyles>
                            <asp:MenuItemStyle CssClass="selectedStyle" BorderStyle="None"
                                ForeColor="#1A8A98"/>
                        </LevelSelectedStyles>
                        <Items>
                            <asp:MenuItem Text="综合信息" Value="0" Selected="True"></asp:MenuItem>
                            <asp:MenuItem Text="市场快递" Value="1"></asp:MenuItem>
                            <asp:MenuItem Text="服务咨询" Value="2"></asp:MenuItem>
                        </Items>
                    </asp:Menu>
                </div>
                <br />
                <br />
                <div style="width: 480px;height:100%;float: left;">
                    <asp:MultiView ID="NewsMultiView" runat="server" ActiveViewIndex="0">
                        <asp:View ID="View1" runat="server">
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Font-Size="Smaller"
                                ShowHeader="False" CssClass="GridView" PageSize="3" GridLines="None" Width="450px">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <table cellspacing="1" class="style1">
                                                <tr>
                                                    <td class="style3">
                                                    <a href="zhxx_content.aspx?id=<%#Eval("n_id")%>">
                                                       ·<lable><%#Eval("title").ToString().Length > 20 ? (Eval("title").ToString().Substring(0, 17) + "...") : Eval("title").ToString()%>
                                                         </lable>
                                                        <%--<asp:Label ID="Label1" runat="server" Text='<%#Eval("title").ToString().Length > 20 ? (Eval("title").ToString().Substring(0, 17) + "...") : Eval("title").ToString()%>'></asp:Label>--%>
                                                    </a>
                                                    </td>
                                                    <td class="style4">
                                                        <%# DataBinder.Eval(Container.DataItem, "add_Time ", "{0:yyyy-MM-dd}")%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <RowStyle BorderStyle="None"/>
                            </asp:GridView>
                            <a href="gongsixinwen.aspx">
                                <asp:Image ID="Image2"  runat="server" ImageUrl="../images/more.gif" style="float: right; margin: 10px 30px 0 0;" /></a>
                        </asp:View>
                        <asp:View ID="View2" runat="server">
                            <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Font-Size="Smaller"
                                ShowHeader="False" CssClass="GridView" PageSize="3" GridLines="None">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <table cellspacing="1" class="style1">
                                                <tr>
                                                    <td class="style3">
                                                    <a href="sckd_content.aspx?id=<%#Eval("n_id")%>">
                                                        ·<lable><%#Eval("title").ToString().Length > 20 ? (Eval("title").ToString().Substring(0, 17) + "...") : Eval("title").ToString()%></lable>
                                                    </a>
                                                    </td>
                                                    <td class="style4">
                                                        <%# DataBinder.Eval(Container.DataItem, "add_Time ", "{0:yyyy-MM-dd}")%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <a href="gongsixinwen1.aspx">
                                <asp:Image ID="Image3" runat="server" ImageUrl="../images/more.gif" style="float: right; margin: 10px 30px 0 0;" /></a>
                        </asp:View>
                        <asp:View ID="View3" runat="server">
                            <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" Font-Size="Smaller"
                                ShowHeader="False" CssClass="GridView" PageSize="3" GridLines="None">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <table cellspacing="1" class="style1">
                                                <tr>
                                                    <td class="style3">
                                                    <a href="fwzx_content.aspx?id=<%#Eval("n_id")%>">
                                                        ·<lable><%#Eval("title").ToString().Length > 20 ? (Eval("title").ToString().Substring(0, 17) + "...") : Eval("title").ToString()%></lable>
                                                    </a>
                                                    </td>
                                                    <td class="style4">
                                                        <%# DataBinder.Eval(Container.DataItem, "add_Time ", "{0:yyyy-MM-dd}")%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <a href="gongsixinwen2.aspx">
                                <asp:Image ID="Image4" runat="server" ImageUrl="../images/more.gif"  style="float: right; margin: 10px 30px 0 0;" /></a>
                        </asp:View>
                    </asp:MultiView>
                </div>

 

 

后台:

 

protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
        {

            NewsMultiView.ActiveViewIndex = int.Parse(this.Menu1.SelectedItem.Value);

        }

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值