一.淘宝移动端首页
pc端实在不会写,基础太差,目前阶段只能照猫画猫,我在复习复习
1.效果图
2.代码部分
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>淘宝手机版</title>
<link rel="stylesheet" href="css/reset.css" />
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header,footer {
height: 50px;
position: fixed;
}
header {
top: 0;
left: 0;
right: 0;
z-index: 1;
}
main {
min-height: 2000px;
/* overflow: hidden; */
position: relative;
top: 50px;
}
footer {
background-color: yellowgreen;
left: 0;
right: 0;
bottom: 0;
}
/* 页眉布局 */
header {
display: grid;
grid-template-columns: 0.58rem 1fr 0.33rem;
grid-template-rows: 0.5rem;
place-items: center;
gap: 0.1rem;
}
header a.logo {
padding-left: 0.1rem;
}
header a.search {
width: 100%;
border: 1.5px solid #ff5000;
height: 0.31rem;
border-radius: 0.3rem;
display: flex;
place-content: space-between;
place-items: center;
}
header a.search > span:first-of-type {
padding-left: 0.1rem;
}
header a.search > span:last-of-type {
background: linear-gradient(to left, #ff5000, #ffc000);
color: white;
padding: 0.04rem 0.2rem;
border-radius: 0.3rem;
margin-right: 0.03rem;
}
header a.iconfont {
font-size: large;
}
</style>
</head>
<body>
<!-- 首页 -->
<header>
<a class=”logo“ href="https://m.taobao.com"><img src="images/nav/logo.png" alt="缓存中"></a>
<a href="" class="search">
<span>寻找宝贝店铺</span>
<span>搜索</span>
</a>
<a href="" class="iconfont"><img src="images/nav/qiandao.png" alt="缓存中"></a>
</header>
<!-- 主体 -->
<main>主体</main>
<!-- 页脚 -->
<footer>页脚</footer>
</body>
</html>