JavaWeb_CSS(20)_列表菜单制作

本系列博客汇总在这里:JavaWeb_CSS 汇总


竖向菜单

<!DOCTYPE html>
<html>
	<head>	
		<meta charset="UTF-8">
		<title>www.weiyuxuan.com</title>		
	</head>	
		<style type="text/css">
			body
			{
				background-color: silver;
				font-family: 黑体;
				font-size: 15px;
			}			
			ul
			{
				list-style-type: disc;				
			}			
			ul li
			{				
				width: 200px;
				text-align: center;
				height: 20px;
				margin-bottom: 1px;
				background-color: orange;							
			}			
			li a
			{
				display:block;
				text-decoration: none;
				color: white;
			}
			li:HOVER 
			{
				background-color:gray;				
			}
			li a:HOVER /*鼠标放上去的颜色*/
			{
				color: silver;
			}
			a:VISITED /*鼠标点过后的颜色*/
			{
				color: red;
			}
		</style>	
	<body>
		<h1> 列表样式 </h1>
		<hr/>
		<ul>
			<li><a href="#">三国</a></li>
			<li><a href="#">水浒</a></li>
			<li><a href="#">红楼梦</a></li>
			<li><a href="#">西游记</a></li>
		</ul>		
	</body>	
</html>

在这里插入图片描述

横向菜单

<!DOCTYPE html>
<html>
	<head>	
		<meta charset="UTF-8">
		<title>www.weiyuxuan.com</title>		
	</head>	
		<style type="text/css">
			body
			{
				background-color: #a1b136;
				font-family: 楷体;
				font-size: 15px;
			}			
			ul
			{
				list-style-type: none;				
			}			
			ul li
			{		
				padding-top:3px;	
				width: 100px;
				text-align: center;
				height: 20px;
				margin-right: 2px;
				background-color: orange;	
				float: left;	
				border-bottom: 5px solid gray;									
			}			
			li a
			{
				display:block;				
				text-decoration: none;
				color: white;
			}
			li:HOVER /*鼠标放上去的边框*/
			{
				background-color:gray;	
				border: 1px solid black;			
			}
			li a:HOVER /*鼠标放上去的颜色*/
			{
				color: green;
			}
			a:VISITED /*鼠标点过后的颜色*/
			{
				color: red;
			}
		</style>		
	<body>
		<h1> 列表样式 </h1>
		<hr/>
		<ul>
			<li><a href="#">三国</a></li>
			<li><a href="#">水浒</a></li>
			<li><a href="#">红楼梦</a></li>
			<li><a href="#">西游记</a></li>
		</ul>		
	</body>	
</html>

在这里插入图片描述
如有错误,欢迎指正!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值