HTML5和CSS3⼩案例
代码:
<!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>
<style>
*{
text-align: center;
border-radius: 15px;
html代码转链接margin: 0 auto 15px;
color: white;
font-size: 20px;
}
header{
width: 800px;
height: 100px;
line-height: 100px;
margin-top: 20px;
background-color: salmon;
}
nav{
width: 800px;
height: 50px;
line-height: 50px;
background-color: darkcyan;
}
section{
width: 800px;
background-color: sandybrown;
}
}
article{
position: relative;
float: left;
width: 392.5px;
height: 200px;
background-color: skyblue;
margin-right: 15px;
}
article>section{
position: absolute;
bottom: 20px;
left: 50%;
transform:translateX(-50%);
width: 250px;
height: 80px;
line-height: 80px;
background-color: wheat;
}
aside{
float: left;
width: 392.5px;
height: 200px;
background-color: darkorange;
}
article>span,
aside>span{
display: inline-block;
margin-top: 20px;
}
footer{
clear: both;
width: 800px;
height: 100px;
line-height: 100px;
background-color: palegreen;
}
</style>
</head>
<body>
<header>
<span><header></span>
</header>
<nav>
<span><nav></span>
</nav>
<section>
<article>
<span><article></span>
<section>
<span><section></span>
</section>
</article>
<aside>
<span><aside></span>
</aside>
</section>
<footer>
<footer>
</footer>
</body>
</html>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论