html+css综合练习一

一、小米注册页面

1、要求

阅读下列说明、效果图,进行静态网页开发。
某网站注册页面开发项目,点击立即注册,进入第二个页面。项目名称为xiaomi,包含首页index.html、css文件夹,其中,css文件夹包含style.css文件。

2、案例图

在这里插入图片描述

在这里插入图片描述

3、实现效果

分析:

  1. 两个页面的切换用a标签来实现
  2. 输入框可以使用盒子模型来完成布局,也可以用input标签来完成效果
  3. 注意input,type属性中text,button,radio等属性值

请添加图片描述

3.1、index.html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<link rel="stylesheet" type="text/css" href="css/style.css"/>
	<body>
		<div class="all">
			<div class="img">
			</div>
			<h1>注册小米账号</h1>
			<div class="middle">
				<p>国家/地区</p>
				<input class="input1" type="text" placeholder="  中国"/>
				<input class="input_right" type="text" placeholder=""/>
				<p>成功注册账号后,国家/地区将不能被修改</p>
				<br>
				<p>手机号码</p>
				<select name="" class="select">
					<option value="">+86</option>
					<option value="">+87</option>
				</select>
				<input class="input2" type="text" placeholder="  请输入手机号码" />
				<br>
				<br>
				<a href="index2.html"><input class="input3" type="button" name="" id="" value="立即注册" /></a>
			</div>
			<div class="radio">
				<input type="radio" name="" id="" value="" />
				<span class="gray">注册账号即表示您同意并愿意遵守小米<span class="mark">用户协议</span><span class="mark">隐私策略</span></span>
			</div>
			<div class="bottom">
				<ul>
					<li>简体</li>
					<li>|</li>
					<li>繁体</li>
					<li>|</li>
					<li>English</li>
					<li>|</li>
					<li>常见问题</li>
				</ul>
				<p>小米公司版权所有-京ICP备1004644-京公网安备11010802020134号京ICP证110507号</p>
			</div>
		
		
		
		</div>
	</body>
</html>

3.2、style.css

*{
	margin: 0;
	padding: 0;
}
.all{
	width: 600px;
	height: 510px;
	border: 1px solid #9D9D9D;
	margin: 20px auto;
}
.img{
	width: 50px;
	height: 50px;
	margin: 0 auto;
	background: url(../img/logo.jpg) no-repeat;
	background-size: 100% 50px;
}
h1{
	width: 200px;
	height: 50px;
	text-align: center;
	margin: 25px auto;
	font-family: 等线;
}
.middle{
	width: 400px;
	height: 250px;
	margin: 0 auto;
	padding-left: 130px;
}
.input1{
	width: 265px;
	height: 35px;
	border: 1px solid #e8e8e8;
}
.input_right{
	width: 35px;
	height: 35px;
	border: 1px solid #e8e8e8;	
	position: relative;
	left: -5px;
	top: 2px;
	text-align: center;
	font-size:18px;
}
.select{
	width: 50px;
	height: 37px;
	border: 1px solid #e8e8e8;
}
.input2{
	width:250px;
	height: 35px;
	position: relative;
	left: -5px;
	border: 1px solid #e8e8e8;
}
.input3{
	width: 300px;
	height: 40px;
	text-align: center;
	background-color: #ff6700;
	color: white;
	border: none;
}
p,span{
	font-size: 13px;
	margin: 5px 0px;
	color: #333333;
}
.radio{
	width: 400px;
	height: 50px;
	text-align: center;
	margin: 0 auto;
}
.radio input{
	border: 1px solid #e8e8e8;
	position: relative;
	top: 2px;
	width: 15px;
	height: 15px;
}
.gray{
	color: #9d9d9d;
}
.mark{
	font-weight: bold;
	color: #000000;
}
ul{
	width: 250px;
	height: 30px;
	margin: 0 auto;
}
li{
	list-style: none;
	color: #333333;
	float: left;
	margin: 0px 5px;
	font-size: 13px;
}
.bottom{
	width: 100%;
	height: 60px;
	background-color: #f9f9f9;
}
.bottom p{
	margin-left: 50px;
	color: #9D9D9D;
}

/* 第二个页面 */
.all2{
	width: 600px;
	height: 460px;
	border: 1px solid #000000;
	margin: 20px auto;
}
.middle span{
	color: #FF6700;
}
.input4{
	width: 300px;
	height: 40px;
	text-align: center;
	color: black;
	background-color: white;
	margin-top: 10px;
	border: 1px solid #E8E8E8;
}
.code{
	width: 200px;
	height: 35px;
	border: 1px solid #e8e8e8;
}
.code2{
	width: 90px;
	height: 36px;
	border: 1px solid #e8e8e8;
	background-color: white;
	color: gray;
}
.please{
	margin-top: 10px;
}

二、下午茶页面

1、要求

阅读下列说明、效果图,进行静态网页开发。
项目包含首页index.html、img文件夹和css文件夹,页面效果如图所示

2、案例图

在这里插入图片描述

3、index.html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<link rel="stylesheet" type="text/css" href="css/style.css"/>
	<body>
		<div class="all">
			<img class="tea" src="img/4004a41.png" >
			<input class="search" type="text" placeholder="  搜索"/>
			<input class="search2" type="button" value="搜索" />
			<br>		
			<table class="table" border="0" cellspacing="15">
				<tr>
					<td>普洱茶</td>
					<td>黑茶</td>
					<td>白茶</td>
				</tr>
				<tr>
					<td>红茶</td>
					<td>绿茶</td>
					<td>花茶</td>
				</tr>
				<tr>
					<td>乌龙茶</td>
					<td>龙井茶</td>
					<td>粉茶</td>
				</tr>
				</table>
				
				<div class="middle">
						<div class="left">
							<h2>店铺优惠券</h2>
							<p>先领券 在购物</p>
						</div>
						<div class="right">
							<div class="money">
								<h2>¥10</h2>
								<p>满100¥可用</p>
							</div>
							<div class="aleady">
								<p></p>
								<p></p>
								<p></p>
							</div>
						</div>
					</div>		
				<div class="bottom">
					<div class="new">
						<p>新品推荐</p>
					</div>
					<div class="box">
						<img src="img/1606161623506004.jpg" >
						<p>绿茶大降价</p>
						<p class="price">¥100</p>
					</div>
					
					<div class="box">
						<img src="./img/4004a41.png" >
						<p>绿茶大降价</p>
						<p class="price">¥100</p>
					</div>			
						
					<div class="box">
						<img src="img/TB1AmjPFVXXXXXGXFXXXXXXXXXX_!!0-item_pic.jpg_240x240.jpg" >
						<p>绿茶大降价</p>
						<p class="price">¥100</p>
					</div>
					
					<div class="box">
						<img src="img/TB1SJUPGpXXXXaQXFXXXXXXXXXX_!!0-item_pic.jpg_240x240.jpg" >
						<p>绿茶大降价</p>
						<p class="price">¥100</p>
					</div>
					
					<div class="box">
						<img src="img/TB1sRuyIpXXXXaSXFXXXXXXXXXX_!!0-item_pic.jpg_240x240.jpg" >
						<p>绿茶大降价</p>
						<p class="price">¥100</p>
					</div>
					
					<div class="box">
						<img src="img/TB2HLUgpFXXXXX7XFXXXXXXXXXX-117206891.jpg_240x240.jpg" >
						<p>绿茶大降价</p>
						<p class="price">¥100</p>
					</div>
					
					<div class="box">
						<img src="img/TB2s7sqdXXXXXa_XXXXXXXXXXXX_!!1723239607.jpg_430x430q90.jpg" >
						<p>绿茶大降价</p>
						<p class="price">¥100</p>
					</div>
				</div>			
		</div>
	</body>
</html>

4、style.css

*{
	margin: 0;
	padding: 0;
}
.all{
	width: 500px;
	height: 1500px;
	border: 1px solid black;
	margin: 0 auto;
	background-color: #f1f1f1;
}
.all  .tea{
	width: 500px;
	height: 200px;
}
.search{
	width: 400px;
	height: 30px;
	border: none;
	background-color: white;
	margin-left: 10px;
	margin-top: 12px;
}
.search2{
	width: 70px;
	height: 30px;
	border: none;
	background-color: #69a84f;
	color: white;
	border-radius: 0px 5px 5px 0px;
	margin-top: 12px;
}
.table{
	width: 500px;
	height: 150px;
	text-align: center;
}
.table td{
	width: 150px;
	background-color: #69A84F;
	color: white;
}
.middle{
	width: 500px;
	height: 120px;
}
.middle .left{
	float: left;
	width: 245px;
	height: 120px;
	text-align: center;
}
.middle .left h2{
	font-size: 22px;
	color: red;
	font-family: 等线;
	margin-top: 40px;
}
.middle .left p{
	color: #9D9D9D;
}
.middle .right{
	float: left;
	width: 245px;
	height: 120px;
	background: url(../img/Color1.png) no-repeat;
	background-size: 230px;
	background-position: center;
}
.right .money{
	float: left;
	width: 190px;
	height: 100px;
	color: white;
	text-align: center;
}
.right .money h2{
	font-size: 20px;
	font-weight: 400;
	margin-top: 30px;
}

.right .aleady{
	float: left;
	width: 50px;
	height: 100px;
	color: white;
	text-align: center;
	margin-top: 30px;
}
.bottom{
	width: 500px;
	height: 500px;
}
.bottom .new{
	width: 500px;
	height: 40px;
	background-color: #69A84F;
}
.new p{
	color: white;
	margin-left: 10px;
	line-height: 40px;
}
.bottom .box{
	width: 230px;
	height: 220px;
	float: left;
	margin: 9px 9px 0px 9px;
	border: 1px solid #9D9D9D;
}
.box img{
	width: 230px;
	height: 170px;
}
.box .price{
	color: red;
}
.box p{
	margin-left: 10px;
}

三、法国巴黎页面

1、要求

阅读下列说明、效果图,进行静态网页开发。
项目包含首页index.html、img文件夹和css文件夹,页面效果如图所示

2、案例图

在这里插入图片描述

3、index.html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<link rel="stylesheet" type="text/css" href="css/style.css"/>
	<body>
		<div class="all">
			<img class="world" src="img/图片1.png" >
			<div class="top">
			</div>
			<div class="box">
				<img src="img/图片2.png" >
				<p>图图直播</p>
			</div>
			<div class="box">
				<img src="img/图片2.png" >
				<p>无涯规则</p>
			</div>
			<div class="box">
				<img src="img/图片2.png" >
				<p>会员专区</p>
			</div>
			<div class="box">
				<img src="img/图片2.png" >
				<p>手信商城</p>
			</div>
			
			<div class="clear">
				
			</div>
			<div class="middle">
				<p><span class="have">直播预告:</span>国学鬼才孙建坤解读《山海经》</p>
				<img class="black" src="img/live.jpg" >
				<img class="black" src="img/live11.jpg" >
				<p class="have">无涯视频</p>
				
				<div class="box2">
					<img src="img/live1.jpg" >
					<p>读书也读你,带你品味读书中的乐趣</p>
				</div>
				<div class="box2">
					<img src="img/live2.jpg" >
					<p>读书也读你,带你品味读书中的乐趣</p>
				</div>
				<div class="box2">
					<img src="img/live3.jpg" >
					<p>读书也读你,带你品味读书中的乐趣</p>
				</div>
				<div class="box2">
					<img src="img/live4.jpg" >
					<p>读书也读你,带你品味读书中的乐趣</p>
				</div>
				
				<p class="have">人气公社</p>
				<div class="box3">
					<img src="./img/live-1.jpg" >
					<p>传统文化</p>
				</div>
				<div class="box3">
					<img src="./img/live-2.jpg" >
					<p>中华经典</p>
				</div>
				<div class="box3">
					<img src="./img/live-3.jpg" >
					<p>商业管理</p>
				</div>
				<div class="box3">
					<img src="./img/live-4.jpg" >
					<p>风景观光</p>
				</div>
				<div class="box3">
					<img src="./img/live-1.jpg" >
					<p>文明古迹</p>
				</div>
				
				<p class="have">商城精选</p>
				<div class="box_left">
					<img src="img/pa1.png" >
				</div>
				<div class="box_right">
					<img src="img/pa2.png" >
				</div>
				<div class="box_right">
					<img src="img/pa3.png" >
				</div>
			</div>
			
			
			
			
			
		</div>
	</body>
</html>

4、style.css

*{
	margin: 0;
	padding: 0;
}
.all{
	width: 500px;
	height: 1700px;
	border: 1px solid black;
	margin: 0 auto;
}
p{
	font-size: 15px;
}
.world{
	width: 500px;
}
.top{
	width: 400px;
	height: 200px;
	margin: 0px auto;
	background: url(../img/banner1.jpg) no-repeat;
	background-position: center;
	background-size: 400px 200px;
	position: relative;
	top: -5px;
}
.box{
	float: left;
	width: 120px;
	height: 100px;
	text-align: center;
}
.box p{
	font-size: 13px;
}
.clear{
	clear: left;
}
.middle{
	width: 500px;
	height: 100%;
	
}
.have{
	font-size: 18px;
	color: #d1bc92;
	font-family: "宋体";
	margin-left: 5px;
}
.middle .black{
	width: 485px;
	height: 200px;
	margin: 5px 0px 0px 15px;
	border-radius: 5px 0px 0px 5px;
}
.middle .box2{
	float: left;
	width: 240px;
	height: 180px;
	margin: 5px 0px 0px 10px;
}
.box2 img{
	width: 240px;
	height: 150px;
}
.box2 p{
	font-size: 13px;
}
.box3{
	float: left;
	width: 90px;
	height: 150px;
	margin: 10px 0px 0px 10px;
	text-align: center;
}
.box3 img{
	width: 90px;
	height: 90px;
}
.box_left{
	float: left;
	width: 240px;
	height: 300px;
	margin: 5px;
}
.box_left img{
	width: 240px;
	height: 300px;
}
.box_right{
	float: left;
	width: 240px;
	height: 150px;
	margin: 5px;
}
.box_right img{
	width: 240px;
	height: 150px;
}


  • 2
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
HTMLCSS和JavaScript是前端开发中最基础的三种技术,它们分别负责网页的结构、样式和交互。下面是对它们的简单介绍: 1. HTML(超文本标记语言):HTML是一种用于创建网页结构的标记语言。通过使用不同的HTML标签,可以定义网页的标题、段落、链接、图像等内容。HTML是网页的骨架,用于描述页面的结构和语义。 2. CSS(层叠样式表):CSS用于控制网页的样式和布局。通过CSS,可以设置网页的字体、颜色、背景、边框等外观效果,还可以实现响应式布局和动画效果。CSSHTML结合使用,可以使网页更加美观和易于阅读。 3. JavaScript(JS):JavaScript是一种脚本语言,用于实现网页的交互功能。通过JavaScript,可以对用户的操作做出响应,实现表单验证、动态内容加载、页面元素的交互效果等。JavaScript可以与HTMLCSS结合使用,使网页具有更强的交互性和动态性。 学习HTMLCSS和JavaScript可以按照以下步骤进行: 1. 学习HTML基础:了解HTML标签的基本语法和常用标签,学会创建网页的结构和内容。 2. 掌握CSS样式:学习CSS的基本语法和常用属性,掌握如何设置网页的样式和布局。 3. 学习JavaScript编程:了解JavaScript的基本语法和常用功能,学会使用JavaScript实现网页的交互效果。 4. 综合实践:通过实际项目或练习,将HTMLCSS和JavaScript结合起来,实现一个完整的网页或Web应用程序。 在学习过程中,可以参考一些优秀的教程和资源***www.w3schools.com/)等。此外,还可以通过阅读相关书籍、参加在线课程或加入开发社区来提升自己的技能。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微笑伴你而行

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值