BulletedList用途

本文介绍如何使用ASP.NET中的BulletedList控件来创建网页导航条,并提供了具体的HTML及CSS样式代码示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.用作最普通的信息显示(列表方式)

2.制作导航条

BulletedList3中模式

  1.Text 文本

  2.HyperLink 连接

  2.LinkButton 按钮

BulletedList 导航条实例

 

    <title>欢迎光临本网站</title>
    <style type="text/css"> /*创建CSS样式表*/
        .style1 {
            /*设置 外边缘和内边缘为0px 边框底部 1px 实线 灰色  边框顶部1px 实线 灰色 */
            margin:0px;padding:0px;border-bottom:1px solid #ccc;border-top:1px solid #ccc;
            /*背景图片在image文件夹里的back.jpg文件*/
            background-image:url(image/back.jpg);
        }
            .style1 li {
                /*display :内行快 添补 15 30 15 30  边框右侧 1px 实线 #ddd */
                display:inline-block;padding:15px 30px 15px 30px;border-right:1px solid #ddd;
            }
            .style1 a {
                /*a标签 字体灰色 下划线取消*/
                color:#666;
                text-decoration:none;
            }

        .style1 a:hover
        /*在a标签上盘旋时  颜色红色*/
        {color:red;}
    </style>         

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:BulletedList ID="BulletedList1" runat="server" CssClass="style1" DisplayMode="HyperLink">
            <asp:ListItem Value="http://www.baidu.com">首页</asp:ListItem>
            <asp:ListItem Value="http://51cto.com">相册</asp:ListItem>
            <asp:ListItem Value="http://yun.baidu.com">论坛</asp:ListItem>
            <asp:ListItem Value="http://yun.baidu.com">购物</asp:ListItem>
            <asp:ListItem Value="http://yun.baidu.com">结账</asp:ListItem>
            <asp:ListItem Value="http://yun.baidu.com">APP</asp:ListItem>
            <asp:ListItem Value="http://yun.baidu.com">日记</asp:ListItem>
        </asp:BulletedList>
        
    </div>
    </form>
</body>
</html>

 

 

转载于:https://www.cnblogs.com/xiaowie/p/9149693.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值