导航条案例练习

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>导航条案例练习</title>
	<base href="#" target="blank"> <!-- 设置将页面中所有的a标签都在新的页面打开 -->
	<style>
		.nav {
			height: 60px;
			width: 1200px;
			background-color: #C6F1E7; 
			text-align: center; /*设置div中字体水平居中*/
			margin: auto; /*设置div水平垂直居中*/
		}
		a {
			display: inline-block; /*经a标签转换为行内块元素*/
			width: 100px;
			height: 60px;
			line-height: 60px;
	/*设置文字垂直居中,a标签的文字垂直居中很简单,只需要设置
	line-height属性即可,将像素值设置的和高度一致就是垂直居中了。*/
			text-decoration: none; /*取消超链接下划线*/
			color: #404B69;
			font-weight: 700; 
			
		}
		a:hover {
			background-color: green;
			color: yellow;
			text-decoration: underline; /*设置超链接下划线*/
			
		}

	</style>
</head>
<body>
	<div class="nav">
			<a href="http://www.iqiyi.com/">爱奇艺</a>
			<a href="https://www.baidu.com/">百度</a>
			<a href="http://www.kugou.com/">酷狗音乐</a>
			<a href="http://aaqqy.com/">影视大全</a>
			<a href="https://www.taobao.com/">淘宝网</a>
			<a href="https://www.autohome.com.cn">汽车之家</a>
			<a href="https://www.tmall.com">天猫</a>
			<a href="http://www.cnki.net/">中国知网</a>
	</div>
</body>
</html>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值