前端html+css+js开发:定位导航(附源码)

效果图:

 

 

css代码:

			* {
				margin: 0;
				padding: 0;
			}
			body {
				font-size: 12px;
				line-height: 1.7;
			}
			li {
				list-style: none;
			}
			#content {
				width: 800px;
				margin: 0 auto;
				padding: 20px;
			}
			#content h1 {
				color: #0088BB;
			}
			#content .item {
				padding: 20px;
				margin-bottom: 20px;
				border: 1px dotted #0088BB;
			}
			#content .item h2 {
				font-size: 12px;
				font-weight: bold;
				border-bottom: 2px solid #00FFFF;
				margin-bottom: 10px;
			}
			#content .item li {
				display: inline;
				margin-left: 10px;
			}
			#content .item li a img {
				width: 230px;
				height: 230px;
				border: none;
			}
			
			#menu {
				position: fixed;
				top: 100xp;
				left: 50%;
				margin-left: 400px;
				width: 80px;
			}
			#menu ul li a {
				display: block;
				margin: 5px 0;
				font-size: 14px;
				font-weight: bold;
				color: #333;
				width: 80px;
				height: 50px;
				line-height: 50px;
				text-align: center;
				text-decoration: none;
			}
			#menu ul a:hover {
				color: #fff;
				background-color: aqua;
			}
			#menu ul li .current {
				color: #fff;
				background-color: aqua;
			}

html代码:

<div id="menu">
			<ul>
				<li><a href="#item1" class="current">A区域</a></li>
				<li><a href="#item2">B区域</a></li>
				<li><a href="#item3">C区域</a></li>
				<l
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值