html代码
<link rel="stylesheet" href="./css/index.css">
<script src="./js/index.js"></script>
<!--顶部登陆区域-->
<div class="nav">
<div class="content">
<div class="title">php中文网,程序员梦开始的地方</div>
<div class="right">
<div><img src="https://img.icons8.com/office/16/000000/appointment-reminders--v1.png" /></div>
<div><img style="width: 25px; height: 25px;" src="./static/touxiang.png" alt="touxiang"></div>
</div>
</div>
</div>
<!--顶部导航栏-->
<div class="daohang">
<a href=""><img src="./static/logo.png" alt="logo"></a>
<div class="item">
<a href="">首页</a>
<a href=""> 视频教程</a>
<a href="">学习路径</a>
<a href="">php培训</a>
<a href="">资料下载</a>
<a href="">技术文章</a>
<a href="">社区</a>
<a href="">APP下载</a>
<a href="">***</a>
</div>
<div class="search">
<input type="search" placeholder="搜索关键词"><span>?</span>
</div>
</div>
<!--轮播图区域-->
<div class="main">
<div class="lunbotu">
<div class="left">
<a href="">项目*1</a>
<a href="">项目*2</a>
<a href="">项目*3</a>
<a href="">项目*4</a>
<a href="">项目*5</a>
<a href="">项目*6</a>
<a href="">项目*7</a>
<a href="">项目*8</a>
</div>
<div class="center">轮播图</div>
<div class="right">登陆区</div>
<div class="bot">
<div class="title">
<a href="">学习路径</a>
<span>全部7个⇒</span>
</div>
<ul class="detail">
<li class="list">
<img src="./static/touxiang.png" alt="">
<a href="">独孤九贱</a>
<span>9门课程</span>
</li>
<li class="list">
<img src="./static/touxiang.png" alt="">
<a href="">独孤九贱</a>
<span>9门课程</span>
</li>
<li class="list">
<img src="./static/touxiang.png" alt="">
<a href="">独孤九贱</a>
<span>9门课程</span>
</li>
<li class="list">
<img src="./static/touxiang.png" alt="">
<a href="">独孤九贱</a>
<span>9门课程</span>
</li>
<li class="list">
<img src="./static/touxiang.png" alt="">
<a href="">独孤九贱</a>
<span>9门课程</span>
</li>
</ul>
</div>
<div class="wechart">ddd</div>
</div>
</div>
/*项目初始化*/
* {
margin: 0px;
border: 0px;
padding: 0px;
box-sizing: border-box;
}
/*去掉列表前的黑点*/
a {
text-decoration: none;
text-align: center;
}
/*访问前初始化*/
a:link {
font-size: 12px;
color: #000000;
text-decoration: none;
}
/*访问后初始化*/
a:visited {
font-size: 12px;
color: #000000;
text-decoration: none;
}
/*链接初始化*/
li {
list-style: none;
}
/*顶部登基础设置*/
.nav {
width: 100vw;
height: 40px;
background-color: rgb(52, 52, 52);
color: aliceblue;
}
/*顶部内容栏目设置*/
.content {
display: grid;
width: 1000px;
grid-template-columns: 240px 100px;
grid-template-rows: 40px;
place-content: space-between;
margin: auto;
place-items: center;
}
/*顶部登陆设置 登陆略*/
.content .right {
width: 60px;
height: 40px;
display: grid;
grid-template-columns: 30px 30px;
grid-template-rows: 40px;
place-content: space-between;
place-items: center;
line-height: 50%;
}
/* --------导航栏开始----------*/
/* 顶部导航栏
1行10列
grid布局*/
.daohang {
/* 选择div内的所有lu*/
display: grid;
/* 启用grid布局*/
width: 1100px;
/* 宽度设置*/
grid-template-columns: 60px 1fr 200px;
/* 3列1行*/
grid-template-rows: 60px;
/* 子元素上下,左右剧中*/
margin: auto;
place-items: center;
grid-auto-flow: column;
}
.daohang .item {
/* 选择div内的所有lu*/
display: grid;
/* 启用grid布局*/
width: 800px;
/* 宽度设置*/
grid-template-columns: repeat(8, 90px) auto;
/* 10列1行*/
grid-template-rows: 60px;
/* 子元素上下,左右剧中*/
place-content: space-between;
place-items: center;
}
/* ----搜索输入-----*/
.daohang input {
background-color: bisque;
margin-left: 10px;
}
/*logo大小设置*/
.daohang a img {
width: 60px;
height: 30px;
}
/* ----搜索框-----*/
.daohang .search {
display: flex;
background-color: bisque;
border-radius: 10px;
}
/* ----轮播开始-----*/
.main .lunbotu {
display: grid;
grid-template-columns: 150px 800px 150px;
grid-template-rows: 400px 100px;
background-color: beige;
place-content: center;
gap: 20px;
margin: 30px auto 30px auto;
}
/* ----网格边界 辅助-----*/
.main .lunbotu>* {
background-color: #ffff;
outline: 1px solid red;
}
/* ----底部跨两行-----*/
.main .lunbotu .bot {
grid-column: span 2;
}
/* ----左边菜单grid布局-----*/
.main .lunbotu .left {
display: grid;
place-items: center;
}
/* ----左边菜单grid布局-----*/
.main .lunbotu .left a {
display: grid;
place-items: center;
padding: 10px 20px 10px 20px;
border-radius: 15px;
}
/* ----左边菜单grid布局鼠标经过效果-----*/
.main .lunbotu .left a:hover {
background-color: darksalmon;
color: red;
}
/* ----下边菜单grid布局-----*/
.main .lunbotu .bot {
display: grid;
grid-template-columns: 100px 1fr;
grid-template-rows: 100px;
place-items: center;
}
/* ----下左边栏目grid布局-----*/
.main .lunbotu .bot .title {
display: grid;
place-items: center;
}
.main .lunbotu .bot .title span {
font-size: 0.1rem;
}
/* ----下边栏目grid布局-----*/
.main .lunbotu .detail {
display: grid;
grid-template-columns: repeat(5, 174px);
grid-template-rows: 20px 20px;
place-items: center;
grid-template-rows: 100px;
}
.main .lunbotu .detail .list {
display: grid;
grid-template-columns: 50px 50px;
grid-template-rows: 20px 20px;
place-content: center start;
place-items: center;
gap: 0 10px;
font-size: 0.08rem;
}
.main .lunbotu .detail .list img {
width: 100%;
grid-row: span 2;
}
.main .lunbotu .detail .list a:hover {
color: red;
}
相关推荐
© 2020 asciim码
人生就是一场修行