CSS 3之美化菜单

1. 无序列表

<ul> 无序列表是网页中常见的元素之一,会用 <li> 标记罗列哥哥项目,且每个项目前都带有特殊符号;
使用 list-style 属性来定义无序列表的项目符号;
无序列表的list-style 语法格式如下所示:

list-style-type:disc | circle | square | none

20220514例子 1:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>美化无序列表</title>
		<style type="text/css">
			*{
				margin: 0px;
				padding: 0px;
				font-size: 15px;
			}
			p{
				margin: 6px 0 0 6px;
				color: #00B7EE;
				font-size: 16PX;
				font-family: 宋体;
			}
			div{
				width: 340px;
				margin: 10px 0 0 10px;
				border: 1px #CCCC77 dashed;
			}
			div ul{
				margin-left: 45px;
				list-style-type: square;
			}
			div li{
				margin: 6px 0 6px;
				color: blue;
				text-decoration: underline;
			}
		</style>
	</head>
	<body>
		<div class="b">
			<p>团购</p>
			<ul>
				<li>文影城:单人影票</li>
				<li>游乐场:现金抵用一次,节假日通用</li>
				<li>烤吧:烤肉双人自助午餐,不限量,全天候</li>
				<li>渔港:6-8人餐,餐具免费</li>
			</ul>
		</div>
	</body>
</html>

20220514

2. 有序列表

<ol>有序类别标记能创建具有顺序的列表;
使用 list-style 属性,能改变有序列表前面的符号;
有序列表的list-style 语法格式如下所示:

list-style-type:decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none

20220514
例子 2:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>有序列表</title>
		<style type="text/css">
			*{
				margin: 0px;
				padding: 0px;
				font-size: 14px;
			}
			p{
				margin: 5px 0 0 5px;
				color: green;
				font-size: 16px;
				font-family: 宋体;
				border-bottom-width: 2px;
				border-bottom-style: solid;
			}
			div{
				width: 300px;
				margin: 10px 0 0 10px;
				border: 1px #B94A48 solid;
			}
			div ol{
				margin-left: 45px;
				list-style-type: upper-alpha;
			}
			div li{
				margin: 6px 0 6px 0;
				color: blue;
			}
		</style>
	</head>
	<body>
		<div class="g">
			<p>图书类型</p>
			<ol>
				<li>人文类</li>
				<li>艺术类</li>
				<li>工程类</li>
				<li>化学类</li>
			</ol>
		</div>
	</body>
</html>

20220514

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值