Web:仿苹果官网首页HTML和CSS

78 篇文章 2 订阅
68 篇文章 0 订阅

根据官网首页仿的,效果图就不贴出来了。
HTML部分具体代码:

<!DOCTYPE html>
<html>
<head>
	<title>Apple</title>
	<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body>
	<div id="all">
		<div id="nav">
			<ul>
				<li>
					<a href="">
						<svg enable-background="new 0 0 14 44" height="44" viewBox="0 0 14 44" width="14" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h14v44h-14z" fill="none"/><path d="m13.0729 17.5214c-.093.0723-1.7248.9915-1.7248 3.0364 0 2.3651 2.0759 3.2017 2.1379 3.2223-.0103.0516-.3305 1.1464-1.0948 2.2618-.6816.9812-1.3943 1.9623-2.4787 1.9623s-1.3633-.63-2.613-.63c-1.2187 0-1.6525.6507-2.644.6507s-1.6835-.9089-2.4787-2.0243c-.9192-1.3117-1.6628-3.3463-1.6628-5.2776 0-3.0984 2.014-4.7406 3.9969-4.7406 1.0535 0 1.9313.692 2.5923.692.63 0 1.6112-.7333 2.8092-.7333.4545.0001 2.0864.0415 3.1605 1.5803zm-3.7284-2.8918c.4957-.5887.8469-1.4046.8469-2.2205 0-.1136-.0103-.2272-.031-.3202-.8056.031-1.7661.5371-2.3445 1.2084-.4544.5164-.8779 1.3323-.8779 2.1586 0 .1239.0207.2479.031.2892.0516.0103.1343.0207.2169.0207.723-.0001 1.6318-.4855 2.1586-1.1362z" fill="#fff"/></svg>
					</a>
				</li>
				<li>
					<a href="">商店</a>
				</li>
				<li>
					<a href="">Mac</a>
				</li>
				<li>
					<a href="">iPad</a>
				</li>
				<li>
					<a href="">iPhone</a>
				</li>
				<li>
					<a href="">Watch</a>
				</li>
				<li>
					<a href="">AirPods</a>
				</li>
				<li>
					<a href="">家居</a>
				</li>
				<li>
					<a href="">Apple独家</a>
				</li>
				<li>
					<a href="">配件</a>
				</li>
				<li>
					<a href="">技术支持</a>
				</li>
				<li>
					<a href="">
						<svg xmlns="http://www.w3.org/2000/svg" width="15" height="88" viewBox="0 0 15 88"><rect width="15" height="44" fill="none"/><path d="M13.98,27.343l-3.5-3.5a5.436,5.436,0,1,0-.778.777l3.5,3.5a.55.55,0,1,0,.778-.778ZM1.959,20.418a4.319,4.319,0,1,1,4.319,4.32A4.323,4.323,0,0,1,1.959,20.418Z" fill="#fff"/><rect y="44" width="15" height="44" fill="none"/><path d="M13.98,71.593l-3.5-3.5a5.436,5.436,0,1,0-.778.777l3.5,3.5a.55.55,0,1,0,.778-.778ZM1.959,64.668a4.319,4.319,0,1,1,4.319,4.32A4.323,4.323,0,0,1,1.959,64.668Z" fill="#86868b"/></svg>
					</a>
				</li>
				<li>
					<a href="">
						<svg height="44" viewBox="0 0 13 44" width="13" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m0 44h13v-44h-13z"/><path d="m12 25.9c0 .6-.5 1.1-1.1 1.1h-8.8c-.6 0-1.1-.5-1.1-1.1v-7.9c0-.5.5-1 1.1-1h8.9c.6 0 1.1.5 1.1 1.1v7.8zm-5.5-11.9c1.2 0 2.1.9 2.3 2h-4.6c.2-1.1 1.1-2 2.3-2zm4.4 2h-1.1c-.2-1.7-1.6-3-3.3-3s-3.1 1.3-3.3 3h-1.1c-1.2 0-2.1.9-2.1 2.1v7.9c0 1.1.9 2 2.1 2h8.9c1.1 0 2.1-.9 2.1-2.1v-7.9c-.1-1.1-1-2-2.2-2z" fill="#fff"/></g></svg>
					</a>
				</li>
			</ul>
		</div>
		<p id="advertise">
			还有机会,快选购节日好礼。可亲临Apple Store零售店取货,或享受免费送货。
			<a href="">立即选购 ></a>
		</p>
		<div id="contents">
			<div id="content1">
				<div id="content1_1">
					<img src="images/logo2.jpg">
					<h2>及时好礼,人见人爱</h2>
					<a href="">选购好礼 ></a>
				</div>
				<div id="content1_2">
					<img src="images/gift.jpg">
				</div>
			</div>
			<div id="content2">
				<div id="content2_1">
					<h2>iPhone 13 Pro</h2>
					<h3>强得很</h3>
					<a href="">进一步了解 ></a>
					<a href="">购买 ></a>
				</div>
				<div id="content2_2">
					<img src="images/iphone13pro.jpg">
				</div>	
			</div>
			<div id="content3">
				<div id="content3_1">
					<h2>iPhone 13</h2>
					<h3>解锁超能力</h3>
					<a href="">进一步了解 ></a>
					<a href="">购买 ></a>
				</div>
				<div id="content3_2">
					<img src="images/iphone13.jpg">
				</div>	
			</div>
			<div id="content4">
				<div id="content4_1">
					<h3>WATCH</h3>
					<h6>SERIES 7</h6>
					<h4>系统升个级,就能记录单通道心电图。</h4>
					<a href="">进一步了解 ></a>
					<h5>
						产品名称:移动心电图房颤提示软件。请仔细阅读产品说明书或者在医务人员的指导下购买和使用。<br>禁忌内容或者注意事项详见说明书。沪械广审(文)第260620-21895号
					</h5>
				</div>
				<div id="content4_2">
					<h3>AirPods</h3>
					<h4>全新AirPods支持空间音频,<br>让这份礼唱响节日欢歌。</h4>
					<a href="">进一步了解 ></a>
					<a href="">购买 ></a>
				</div>
			</div>
			<div id="content5">
				<div id="content5_1">
					<h1>HomePod mini</h1>
					<a href="">进一步了解 ></a>
					<a href="">购买 ></a>
				</div>
				<div id="content5_2">
					<h1>MacBook Pro</h1>
					<h4>强者的强</h4>
					<a href="">进一步了解 ></a>
					<a href="">购买 ></a>
				</div>
			</div>
			<div id="content6">
				<div id="content6_1">
					<h1>iPad mini</h1>
					<h4>小写的大</h4>
					<a href="">进一步了解 ></a>
					<a href="">购买 ></a>
				</div>
				<div id="content6_2">
					<h1>AirTag</h1>
					<h4>丢三落四这门绝技,要失传了。</h4>
					<a href="">进一步了解 ></a>
					<a href="">购买 ></a>
				</div>
			</div>
		</div>
		<div id="footer">
			<div id="lists">
				<div class="list">
					<ul>
						<li>选购及了解</li>
						<li>
							<a href="">商店</a>
						</li>
						<li>
							<a href="">Mac</a>
						</li>
						<li>
							<a href="">iPad</a>
						</li>
						<li>
							<a href="">iPhone</a>
						</li>
						<li>
							<a href="">Watch</a>
						</li>
						<li>
							<a href="">AirPods</a>
						</li>
						<li>
							<a href="">家居</a>
						</li>
						<li>
							<a href="">iPod touch</a>
						</li>
						<li>
							<a href="">AirTag</a>
						</li>
						<li>
							<a href="">配件</a>
						</li>
						<li>
							<a href="">App Store充值卡</a>
						</li>
					</ul>
				</div>
				<div class="list">
					<ul>
						<li>服务</li>
						<li>
							<a href="">Apple Music</a>
						</li>
						<li>
							<a href="">iCloud</a>
						</li>
						<li>
							<a href="">Apple Pay</a>
						</li>
						<li>
							<a href="">Apple 播客</a>
						</li>
						<li>
							<a href="">App Store</a>
						</li>
					</ul>
					<ul>						
						<li>账户</li>
						<li>
							<a href="">管理你的Apple ID</a>
						</li>
						<li>
							<a href="">Apple Store账户</a>
						</li>
						<li>
							<a href="">iCloud.com</a>
						</li>
					</ul>
				</div>
				<div class="list">
					<ul>
						<li>Apple Store商店</li>
						<li>
							<a href="">查找零售店</a>
						</li>
						<li>
							<a href="">Genius Bar天才吧</a>
						</li>
						<li>
							<a href="">Today at Apple</a>
						</li>
						<li>
							<a href="">Apple夏令营</a>
						</li>
						<li>
							<a href="">Apple Store App</a>
						</li>
						<li>
							<a href="">翻新和优惠</a>
						</li>
						<li>
							<a href="">分期付款</a>
						</li>
						<li>
							<a href="">Apple Trade In换购计划</a>
						</li>
						<li>
							<a href="">订单状态</a>
						</li>
						<li>
							<a href="">选购帮助</a>
						</li>
					</ul>
				</div>
				<div class="list">
					<ul>
						<li>商务应用</li>
						<li>
							<a href="">Apple与商务</a>
						</li>
						<li>
							<a href="">商务选购</a>
						</li>
					</ul>
					<ul>
						<li>教育应用</li>
						<li>
							<a href="">Apple与教育</a>
						</li>
						<li>
							<a href="">高校师生选购</a>
						</li>
					</ul>
				</div>
				<div class="list">
					<ul>
						<li>Apple价值观</li>
						<li>
							<a href="">辅助功能</a>
						</li>
						<li>
							<a href="">环境责任</a>
						</li>
						<li>
							<a href="">隐私</a>
						</li>
						<li>
							<a href="">供应商责任</a>
						</li>
					</ul>
					<ul>
						<li>关于Apple</li>
						<li>
							<a href="">Newsroom</a>
						</li>
						<li>
							<a href="">Apple管理层</a>
						</li>
						<li>
							<a href="">工作机会</a>
						</li>
						<li>
							<a href="">创造就业</a>
						</li>
						<li>
							<a href="">商业道德与合规性</a>
						</li>
						<li>
							<a href="">活动</a>
						</li>
						<li>
							<a href="">联系Apple</a>
						</li>
					</ul>
				</div>
			</div>
			<p>
				<a href="">查找你附近的Apple Store零售店</a>
				<a href="">更多门店</a>
			</p>
			<hr>
			<p id="pa">
				Copyright © 2021 Apple Inc. 保留所有权利。
				<a href="">隐私政策</a>
				<a href="">使用条款</a>
				<a href="">销售政策</a>
				<a href="">法律信息</a>
				<a href="">网站地图</a>
			</p>
			<p>
				京ICP备10214630 营业执照 无线电发射设备销售备案编号11201910351200
			</p>
		</div>
	</div>	
</body>
</html>

CSS部分具体代码:

*{
	margin: 0;
	padding: 0;
}
ul,li{
	list-style: none;
}
h1{
	font-size: 40px;
	color: #1d1d1f;
}
h2{
	font-size: 56px;
	font-weight: 600;
	color: #1d1d1f;
	display: block;
	width: 100%;	
}
h3{
	color: #1d1d1f;
	font-size: 28px;
	font-weight: 400;
	margin-top: 6px;
	text-align: center;
	width: 100%;
}
h4{
	color: #1d1d1f;
	font-size: 21px;
	font-weight: 400;
	width: 100%;
	margin-top: 6px;
	margin-bottom: 6px;
}
h5{
	color: #6e6e73;
	font-size: 10px;
	text-align: center;
	line-height: 20px;
}
a{
	text-decoration: none;
	color: #06c;
	font-weight: 400;
}
a:hover{
	text-decoration: underline;
}
#all{
	min-width: 1280px;
}
#all #nav{
	width: 100%;
	height: 50px;
	background: rgba(0,0,0,0.8);
	font-size: 14px;
}
#all #nav ul{
	width: 1200px;
	height: 50px;
	margin: 0 auto;
	overflow: hidden;
}
#all #nav ul li{
	float: left;
	line-height: 50px;
	width: 92px;
	text-align: center;
}
#all #nav ul li svg{
	margin-top: 5px;
}
#all #nav ul li a{
	color: white;
}
#all p#advertise{
	width: 100%;
	height: 50px;
	font-size: 14px;
	line-height: 50px;
	text-align: center;
	background-color: #e34140;
	color: white;
}
#all p#advertise a{
	color: white;
}
#all #contents #content1{
	width: 100%;
	height: 630px;
	background: #eaf3fc;
}
#all #contents #content1 #content1_1{
	width: 100%;
	height: 235px;
	padding-top: 47px;
	text-align: center;
}
#all #contents #content1 #content1_2{
	width: 100%;
	height: 345px;
}
#all #contents #content1 #content1_1 img{
	width: 70px;
	height: 88px;
	display: block;
	margin: 0 auto;
}
#all #contents #content1 #content1_1 h2{
	margin-top: 20px;
}
#all #contents #content1 #content1_1 a{
	font-size: 21px;
}
#all #contents #content1 #content1_2 img{
	height: 345px;
	display: block;
	margin: 0 auto;
}
#all #contents #content2{
	width: 100%;
	background: #fbfbfd;
	margin-top: 15px;
}
#all #contents #content2 #content2_1{
	width: 100%;
	padding-top: 47px;
	text-align: center;
}
#all #contents #content2 #content2_1 h3{
	margin-bottom: 20px;
}
#all #contents #content2 #content2_1 a{
	font-size: 21px;
}
#all #contents #content2 #content2_2 img{
	width: 100%;
	display: block;
	margin: 0 auto;
}
#all #contents #content3{
	width: 100%;
	background: #35283c;
	margin-top: 15px;
}
#all #contents #content3 #content3_1{
	width: 100%;
	padding-top: 47px;
	text-align: center;
}
#all #contents #content3 #content3_1 h2{
	color: white;
}
#all #contents #content3 #content3_1 h3{
	margin-bottom: 20px;
	color: #fec2eb;
}
#all #contents #content3 #content3_1 a{
	font-size: 21px;
	color: #2997ff;
}
#all #contents #content3 #content3_2 img{
	width: 100%;
	display: block;
	margin: 0 auto;
}
#all #contents #content4,#content5,#content6{
	width: 100%;
	height: 580px;
	margin-top: 15px;
	text-align: center;
}
#all #contents #content4 #content4_1{
	width: 49.5%;
	height: 580px;
	background: url("../images/watch.jpg") no-repeat;
	background-position: center;
	float: left;
}
#all #contents #content4 #content4_1 h3:first-child{
	font-weight: 600;
}
#all #contents #content4 #content4_1 h6{
	color: #d0343a;
	font-size: 13px;
}
#all #contents #content4 #content4_1 h5{
	margin-top: 415px;
}
#all #contents #content4 #content4_2{
	width: 49.5%;
	height: 580px;
	float: right;
	background: url("../images/airpods.jpg") no-repeat;
	background-position: center;
	padding-top: 390px;
	box-sizing: border-box;
}
#all #contents #content4 #content4_2 h3{
	color: white;
	font-size: 40px;
}
#all #contents #content4 #content4_2 h4{
	color: white;
}
#all #contents #content4 #content4_2 a{
	color: white;
}
#all #contents #content5 #content5_1{
	width: 49.5%;
	height: 580px;
	background: url("../images/homepodmini.jpg") no-repeat;
	background-position: center;
	float: left;
}
#all #contents #content5 #content5_2{
	width: 49.5%;
	height: 580px;
	background: url("../images/macbookpro.jpg") no-repeat;
	background-position: center;
	float: left;
}
#all #contents #content6 #content6_1{
	width: 49.5%;
	height: 580px;
	background: url("../images/ipadmini.jpg") no-repeat;
	background-position: center;
	float: left;
}
#all #contents #content6 #content6_2{
	width: 49.5%;
	height: 580px;
	background: url("../images/airtag.jpg") no-repeat;
	background-position: center;
	float: left;
}
#all #footer{
	width: 100%;
	/*height: 200px;*/
	background: #f5f5f7;
	margin-top: 15px;
	padding-top: 20px;
}
#all #footer div#lists{
	width: 900px;
	height: 350px;
	margin: 0px auto;
}
#all #footer div#lists div.list{
	width: 180px;
	height: 100%;
	float: left;
	font-size: 12px;
	line-height: 26px;
	color: #424245;
}
#all #footer div#lists div.list ul li:first-child{
	font-weight: bold;
}
#all #footer div#lists div.list ul li a{
	color: #424245;
}
#all #footer p{
	width: 900px;
	height: 30px;
	font-size: 14px;
	margin: 0 auto;
}
#all #footer p#pa a{
	color: #424245;
	border-right: 1px solid #424245;
	padding-right: 5px;
}
#all #footer p#pa a:last-child{
	border: none;
}

具体的用到的图片就不贴出来了,文件名如下图:
web苹果首页
根据需要自行到官网下载图片。

  • 4
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 11
    评论
Python是一门功能强大且易于学习的编程语言,它可以用于构建Web网站。在Python中,我们可以使用许多第三方库或框架来简化Web开发的过程。 首先,我们可以使用Flask或Django这样的Web框架来搭建Web网站。Flask是一个轻量级的框架,适合小型应用或原型开发。而Django是一个全功能的框架,适用于大型应用开发。这两个框架都提供了路由功能、模板引擎、表单处理和数据库集成等重要特性,使Web开发更加简单和高效。 其次,我们可以使用HTMLCSS和JavaScript来设计和布局网页。HTML是用于构建网页结构的标记语言,CSS用于样式设计,而JavaScript用于动态交互和用户体验的改进。Python中,我们可以使用模板引擎来渲染HTML模板,并将数据传递给前端页面进行呈现。 另外,Python还提供了许多有用的库来处理与Web相关的任务。比如,我们可以使用Requests库来进行HTTP请求和响应处理,BeautifulSoup库来解析HTML或XML文档,以及Pillow库来处理图像。 最后,要搭建Python Web网站,我们需要了解基本的Web开发概念,例如Web服务器、路由、请求和响应等。我们还需要学习数据库的基本知识,以便与Web应用程序集成和存储数据。 总而言之,Python是一种优秀的语言,可以用于快速构建Web网站。通过使用适当的库和框架,我们可以简化开发过程,并实现功能丰富的Web应用程序。无论是小型应用还是大型项目,Python都是一个可靠的工具。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

jasmyn518

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

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

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

打赏作者

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

抵扣说明:

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

余额充值