目录
前言
先来看看效果图
HTMl代码段
css的代码段
前言
为了用回html和css于是纯手写了一个ikun的静态网页,发现还挺好玩的,就随便写写了。
先来看看效果图
HTMl代码段
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
<link rel="stylesheet" href="../study.css">
</head>
<body>
<!-- 整体思路就是一个一个标准流写好了,在使用float来实现每行的效果。 -->
<!-- 头部信息 -->
<div class="header w">
<!-- 头部left -->
<div class="logo"><img src="../image/header.png"></div>
<!-- 头部middle -->
<div class="nav">
<ul>
<li><a href="">唱</a></li>
<li><a href="">跳</a></li>
<li><a href="">rap</a></li>
<li><a href="">篮球</a></li>
</ul>
</div>
<!-- 头部right -->
<div class="search">
<input type="text" value="请输入关键词">
<button></button>
</div>
<!-- 用户模块 -->
<div class="user">
<img src="../image/user.png">
<p>只因你太美</p>
</div>
</div>
<!-- banner信息 -->
<div class="banner">
<div class="w">
<!-- 测导航栏模块 -->
<div class="subnav">
<ul>
<li><a href="">唱的课程<span>></span></a></li>
<li><a href="">跳的课程<span>></span></a></li>
<li><a href="">rap的课程<span>></span></a></li>
<li><a href="">篮球的课程<span>></span></a></li>
<li><a href="">七里香<span>></span></a></li>
<li><a href="">心雨<span>></span></a></li>
<li><a href="">说好的幸福呢<span>></span></li>
<li><a href="">搁浅教学<span>></span></a></li>
<li><a href="">折磨的css教学<span>></span></a></li>
</ul>
</div>
<!-- 课程表模块 -->
<div class="course">
<h2>我的课程表</h2>
<div class="bd">
<ul>
<li>
<h4>继续练习唱</h4>
<p>正在学习-搁浅</p>
</li>
</ul>
<br>
<ul>
<li>
<h4>继续练习跳</h4>
<p>正在学习-鸡你太美舞蹈</p>
</li>
</ul>
<br>
<ul>
<li>
<h4>继续练习rap</h4>
<p class="last">正在学习-手写的从前</p>
</li>
</ul>
<br>
<a href="#">全部课程</a>
</div>
</div>
</div>
</div>
<!-- 最喜欢的歌曲推荐 -->
<div class="goods s">
<h3>最喜欢唱</h3>
<ul>
<li><a href="">说好的幸福呢</a></li>
<li><a href="">心雨</a></li>
<li><a href="">爱在西元前</a></li>
<li><a href="">可爱女人</a></li>
<li><a href="">园游会</a></li>
</ul>
<a href="" class="mod">修改兴趣</a>
</div>
<!-- 精品推荐模块 -->
<div class="box s">
<div class="box-hd">
<h3>真ikun推荐</h3>
<a href="">查看全部</a>
</div>
<div class="box-bd">
<ul class="clearfix">
<li>
<img src="../image/微信截图_20230217204430.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/2.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/3.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/4.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/5.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/6.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/7.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/8.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/9.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
<li>
<img src="../image/10.png">
<h4>食不食油饼啊,小黑子!!!</h4>
<div class="info">ikun:0 小黑子:233</div>
</li>
</ul>
</div>
</div>
<!-- 页脚底部 -->
<div class="footer">
<div class="s">
<div class="copyleft">
<img src="../image/0217211708.png">
<div class="name">两耳不闻窗外事,一心只为蔡徐坤。
追梦少年不失眠,<br>未来可期蔡徐坤。
向阳花木每逢春,ikun一直爱坤坤。</div>
<a href="" class="app">关爱蔡徐坤</a>
</div>
<div class="link">
<dl>
<dt>关于蔡徐坤</dt>
<dd><a href="">为什么成鸡</a></dd>
<dd><a href="">成只因日期</a></dd>
<dd><a href="">成只因作品</a></dd>
<dd><a href="">只因你太美</a></dd>
<dd><a href="">彩虹可爱小只因</a></dd>
</dl>
<dl>
<dt>关于蔡徐坤</dt>
<dd><a href="">为什么成鸡</a></dd>
<dd><a href="">成只因日期</a></dd>
<dd><a href="">成只因作品</a></dd>
<dd><a href="">只因你太美</a></dd>
<dd><a href="">彩虹可爱小只因</a></dd>
</dl>
<dl>
<dt>关于蔡徐坤</dt>
<dd><a href="">为什么成鸡</a></dd>
<dd><a href="">成只因日期</a></dd>
<dd><a href="">成只因作品</a></dd>
<dd><a href="">只因你太美</a></dd>
<dd><a href="">彩虹可爱小只因</a></dd>
</dl>
</div>
</div>
</div>
</body>
</html>
css的代码段
* {
margin: 0;
padding: 0;
}
body {
background-color: #e9f4d5;
}
.clearfix:before,.clearfix:after {
content:"";
display: table;
}
.clearfix::after {
clear:both;
}
.clearfix {
*zoom:1;
}
/* 申明版心类,只要像放到中间调用即可 */
.w {
width: 1200px;
margin: 0 auto;
}
/* 只是写错了 */
.s {
width: 1200px;
margin: 0 auto;
}
/* 只要是页面中的所有li都要清除样式 */
li {
list-style: none;
}
a {
text-decoration: none;
}
.header {
height: 52px;
background-color: #D6EFA8;
margin: 30px auto;
}
.logo {
float: left;
width: 133px;
height: 52px;
background-color: purple;
}
.nav {
float: left;
margin-left: 60px;
}
.nav ul li {
float: left;
margin-right: 20px;
padding: 13px;
border: 1px solid lightblue;
}
.nav ul li a {
font-size: 18px;
color: black;
}
.nav ul li:hover {
border-bottom: 3px solid lightblue;
}
.search {
float: left;
/* search的width是412px */
width: 412px;
height: 52px;
background-color: #ceed94;
margin-left: 50px;
}
.search input {
float: left;
/* input的width是345px */
width: 345px;
height: 47px;
border: 2px solid #ceed94;
color: #bfbfbf;
font-size: 14px;
padding-left: 15px;
}
.search button {
float: left;
/* 那为什么button的width是50px就会掉下来了 */
width: 45px;
height: 52px;
background: url(./image/ikunsearch.png);
/* 按钮有边框需要手动取出 */
border: 0;
}
div .user {
float: left;
line-height: 52px;
margin-left: 50px;
}
div p {
float: right;
margin-left: 20px;
}
.banner {
height: 421px;
background-color: #B3CBEF;
}
.banner .w {
height: 421px;
background-image: url(./image/handsome.jpg);
background-repeat: no-repeat top center;
background-size: 1200px 421px;
}
.subnav {
float: left;
width: 190px;
height: 421px;
background: rgba(172, 211, 240, .5);
}
.w .subnav ul li a {
font-size: 20px;
color:rgb(116, 118, 120);
}
.w .subnav ul li {
/* background-color: rgb(172, 211, 240); */
height: 47px;
padding: 0 20px;
}
.w .subnav ul li:hover {
background: #ceed94;
}
.subnav ul li a span {
float: right;
}
.course {
float: right;
margin-top: 50px;
width: 230px;
height: 340px;
background-color: rgba(172, 211, 240,.3);
}
.course h2 {
height: 48px;
background-color: rgba(172, 211, 240);
text-align: center;
line-height: 48px;
font-size: 18px;
color: #fff;
}
.bd {
padding: 0 20px;
}
.course .bd ul li {
padding: 20px 0;
border-bottom: 2px solid #fff;
}
.course .bd ul li h4{
padding-left: 20px;
color: #4e4e4e;
}
.course .bd ul li:hover {
background-color: #ceed94;
}
.course .bd ul li p {
float: left;
color: #a5a5a5;
}
.course .bd ul li p .last {
margin-bottom: 30px;
}
.course .bd a {
display: block;
border:1px solid rgb(123, 187, 236);
padding-left: 20px;
color: whitesmoke;
height: 38px;
line-height: 38px;
font-size: 16px;
}
.goods {
height: 60px;
background-color:whitesmoke;
box-shadow: 0 4px 3px 3px rgba(0,0,0,.3);
margin-top: 10px;
line-height: 60px;
}
.goods h3 {
float: left;
margin-left: 30px;
color: #cfe5a7;
}
.goods ul {
float: left;
}
.goods ul li {
float: left;
}
.goods ul li a {
padding: 0 30px;
color: #050505;
border-left: 2px solid #ceed94 ;
}
.mod {
float: right;
margin-right: 30px;
color: #cfe5a7;
}
.box {
margin-top: 30px;
}
.box-hd {
height: 45px;
}
.box-hd h3 {
float: left;
font-size: 20px;
color: #494949;
}
.box-hd a {
float: right;
font-size: 12px;
color: #a5a5a5;
}
.box-bd ul {
width: 1225px;
}
.box-bd ul li {
float: left;
width: 225px;
height: 320px;
background-color: whitesmoke;
margin-left: 15px;
margin-bottom: 15px;
}
.box-bd ul li img {
width: 100%;
height: 200px;
}
.box-bd ul li h4 {
margin: 20px 20px 20px 25px;
font-size: 14px;
color: plum;
/* 给定标题不加粗 */
font-weight: 400;
}
.box-bd ul li .info {
margin-left: 20px;
color: #999;
font-size: 12px;
}
.footer {
height: 415px;
background-color: #D6EFA8;
}
.footer .s {
padding-top: 35px;
}
.footer .s .copyleft img {
width: 300px;
height: 200px;
}
.copyleft {
float: left;
}
.link {
float: right;
}
.footer .s .copyleft .name {
float: none;
font-size: 12px;
color: #666;
margin: 20px 0 15px 0 ;;
}
.footer .s .copyleft .app {
display: block;
width: 118px;
height: 33px;
border: 2px solid #00a4ff;
line-height: 33px;
color:#00a4ff ;
text-align: center;
font-size: 16px;
}
.link dl {
float: left;
}
.link dl dt {
margin-right: 150px;
font-size: 16px;
color: #333;
margin-bottom: 5px;
}
.link dl dd a {
font-size: 12px;
color: #333;
}