本篇博客实现一个HTML与CSS简单页面效果实例
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="container">
<div class="wrapper">
<div class="heading">
<div class="heading_nav">
<div class="heading_title">
极客学院
</div>
<div class="heading_navbar">
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">职业课程</a></li>
<li><a href="#">技术问答</a></li>
<li><a href="#">VIP会员</a></li>
</ul>
</div>
<div class="heading_img">
<img src="img.jpg">
</div>
<div class="heading_soptlight">
<form>
<input type="text">
</form>
</div>
</div>
</div>
<div class="body">
<div class="body_title">
<h3>熟悉极客学院</h3>
<p>加入极客学院,学习最新实战教程,全面提升你的技术能力</p>
</div>
<hr/>
<hr/>
</div> </div> <div class="footing">
@极客学院
</div> </div>
</body>
</html>
css代码:
*{
margin:0px;
padding:0px;
} body{
background-color: snow;
}
.wrapper{
width:%;
height:1000px;
background-color: antiquewhite;
margin:0px auto;
}
.heading{
width:%;
height:160px;
background-color: snow;
margin:0px auto;
}
ul{
margin-left:40px;
float:left;
list-style-type:none;
padding-top:40px;
padding-bottom:6px;
}
a:link,a:visited{
font-weight:bold;
color:darkgray;
text-align:center;
padding:6px;
text-decoration: none;
}
a:hover,a:active{
color:blue;
}
.heading_title{
float:left;
font-family:Arial,Helvetica,sans-serif;
font-size:30px;
color:burlywood;
}
.heading_nav{
padding-bottom:30px;
padding-top:30px;
width:%;
height:30px;
position:relative;
}
li{
padding-left:10px;
display:inline;
} .heading_img img{
border-radius:30px;
display:inline;
width:46px;
height:46px;
box-shadow: 1px 1px rgba(,,,0.2);
float:right;
} .heading_soptlight form{
float:right;
width:100px;
height:26px;
position:relative;
margin-right:82px;
margin-top:16px;
}
form input{
height:26px;
border-radius:30px;
}
.body{
width:auto;
height:auto;
padding:30px;
}
.body_title h3{
font-size:30px;
font-family:Arial,Helvetical,sans-serif;
color:#;
}
.body_title p{
margin-top:20px;
margin-bottom:20px;
}
.footing{
padding-top:20px;
text-align:center;
fon-size:10px;
color:darkgray;
}
效果: