
批改狀態(tài):合格
老師批語:完成的很好,沒什么問題,繼續(xù)加油
直接上代碼吧
<!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>grid演示</title>
</head>
<body>
<div class="content">
<header>
<nav>
<a href="">首頁</a>
<a href="">視頻</a>
<a href="">社區(qū)</a>
<a href="">文章</a>
<a href="">咨詢</a>
<a href="">簡介</a>
<a href="">源碼</a>
<a href="">作業(yè)</a>
<a href="">下載</a>
</nav>
<button>登陸</button>
</header>
</div>
<footer class="footer">頁腳</footer>
<style>
.box {
width: 100%;
height: 2000px;
}
header {
height: 80px;
background-color: rgb(248, 244, 244);
padding: 0 5em;
display: flex;
place-content: space-between;
position: sticky;
top: 0;
color: #0c0202;
}
nav {
display: flex;
/* 水平垂直居中 */
text-align: center;
line-height: 80px;
}
nav a {
min-width: 5em;
color: #0c0505;
text-decoration: none;
flex: 1;
}
nav a:hover {
color: white;
background-color: aqua;
transition: 0.3s;
}
header button {
border: none;
width: 5em;
background-color: rgb(3, 5, 4);
color: azure;
}
header button:hover {
cursor: pointer;
background-color: rgb(22, 228, 228);
}
footer {
width: 100%;
height: 50px;
color: #ccc;
background-color: black;
text-align: center;
line-height: 50px;
}
.box .title {
height: 50px;
font-weight: bolder;
border: 1px solid #f5f1f1;
background-color: rgb(10, 10, 10);
}
.box .content {
min-width: 100%;
min-height: 0px;
background-color: #eee;
}
.box .title {
/* 滾動到top=0就會自動停止并固定在當(dāng)前位置 */
position: sticky;
top: 0;
color: #9b9292;
line-height: 50px;
padding: 0 20em;
}
.box1 {
width: 100px;
height: 500px;
display: flex;
border: 1px solid #e0e4de6b;
place-content: space-evenly;
flex-flow: column nowrap;
position: fixed;
top: 5cm;
bottom: 0;
/* line-height: 50px; */
border-radius: 20px 20px 20px 20px;
}
.box1 a {
width: 100%;
height: 25px;
letter-spacing: 2px;
text-align: center;
text-decoration: none;
color: #9b9292;
/* flex: 1 1 auto; */
}
.box1 a:hover {
color: white;
background-color: rgb(70, 184, 159);
transition: 0.1s;
}
</style>
</body>
</html>
下面是效果圖,如有錯誤請各位老師和大佬多多指教!
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號