HTML_0414作业

本文通过两个实例展示了如何使用HTML和CSS实现特定的网页布局效果。第一个实例介绍了一个包含多种链接选项的右侧导航栏;第二个实例则展示了一个简洁的商品分类模块。

作业:

完成预览图:

225152_MxuE_3819174.png

代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	div{ float: right; text-align: center; }
	a{ text-decoration: none;  font-size: 15px; }
	.d_zt{ margin-right: 100px; margin-top: 70px;}
	.zc{ width: 50px; height: 30px; background-image: url("images/t2.gif");
		background-position: 3px -26px; }
	.bz{  width: 30px; height: 25px; background-image: url("images/t2.gif"); }
	.bzpink{ background-position: 90px -2px; }
	.bzred{ background-position: 130px -2px; }
	.bzyellow{ background-position: 170px -2px; }
	.bzblack{ background-position: 210px -2px; }
</style>
</head>
<body>
<div class="d_zt">
	<div class="zc"><a href="#">注册</a></div>
	<div class="zc"><a href="#">登录</a></div>
	<div><a href="#">设为首页</a></div>
	<div class="bz bzpink"></div>
	<div><a href="#">加入收藏</a></div>
	<div class="bz bzred"></div>
	<div><a href="#">帮助中心</a></div>
	<div class="bz bzyellow"></div>
	<div><a href="#">购物车</a></div>
	<div class="bz bzblack"></div>
</div>
</body>
</html>

选做题:

完成预览图:

225308_Qwic_3819174.png

代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	div,p{ margin: 0px auto; background-repeat: no-repeat;  }
	.zt{ width: 300px; margin: 0px 0px;  }
	.top{ width: 200px;height: 40px; background-image: url("images/xz.gif");
	 	 background-position: 0px -50px; margin-top: 50px; }
	.top_bt{ width: 60px; font-family: 微软雅黑; font-weight: bold; font-size: 15px; color: #FF9224;
			 line-height: 40px; }
	.fl{ width: 200px; height: 20px; background-image: url("images/xz.gif"); background-position: 0px -80px; }
	.fl_wz{ width: 50px; font-family: 微软雅黑; font-size: 13px; line-height: 20px;}
	.bottom{ width: 200px; height: 25px; background-image: url("images/xz.gif"); background-position: 0px -90px; }
</style>
</head>
<body>
	<div class="zt">
		<div class="top">
			<p class="top_bt">商品分类</p>
		</div>
		<div class="fl"><div class="fl_wz">分类名1</div></div>
		<div class="fl"><div class="fl_wz">分类名2</div></div>
		<div class="fl"><div class="fl_wz">分类名3</div></div>
		<div class="fl"><div class="fl_wz">分类名4</div></div>
		<div class="bottom"></div>
	</div>
</body>
</html>

转载于:https://my.oschina.net/u/3819174/blog/1797033

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值