<!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>berger&fohr</title>
<link rel="stylesheet" href="css/reset.css">
<style>
/* 公共样式 */
html {
font-size:62.5% ;
}
a,span{
color: #000;
font-size: 2rem;
}
nav{
width: 80%;
height: 60px;
background-color: #fff;
position: fixed;
top:0;
}
nav ul {
width: 100%;
height: 60px;
}
</style>
<link rel="stylesheet" href="css/pc.css" media="screen and (min-width:750px)">
<link rel="stylesheet" href="css/phone.css" media="screen and (max-width:750px)">
</head>
<body>
<div class="wrap">
<!-- 导航条部分 -->
<nav>
<ul class="pc">
<li>
<a href="#">Berger & Fohr</a>
</li>
<li>
<a href="#">All Work</a>
<a href="#">Identities</a>
<a href="#">About</a>
</li>
<li>
<a href="#">Art</a> / <a href="#">Store</a>
</li>
</ul>
<ul class="phone">
<li><a href="#">Berger & Fohr</a> </li>
<li><a href="#"></a></li>
</ul>
</nav>
<!-- 图文组合部分 -->
<main>
<div class="item">
<img src="./img/1.gif" alt="">
<p><a href="#">Identity Gallery</a></p>
</div>
<div class="item">
<img src="./img/2.png" alt="">
<p><a href="#">LifeLabs</a></p>
</div>
<div class="item">
<img src="./img/3.jpg" alt="">
<p><a href="#">I can't Breathe</a></p>
</div>
<div class="item">
<img src="./img/4.png" alt="">
<p><a href="#">Lore</a></p>
</div>
<div class="item">
<img src="./img/5.png" alt="">
<p><a href="#">Burton</a></p>
</div>
<div class="item">
<img src="./img/6.gif" alt="">
<p><a href="#">ATLAS Institute</a></p>
</div>
<div class="item">
<img src="./img/7.jpg" alt="">
<p><a href="#">B2</a></p>
</div>
<div class="item">
<img src="./img/8.jpg" alt="">
<p><a href="#">Alleans Renewables</a></p>
</div>
<div class="item">
<img src="./img/9.png" alt="">
<p><a href="#">Saatchi & Saatchi</a></p>
</div>
</main>
<!-- 联系方式 -->
<footer>
<p><a href="#">@bergerfohr</a></p>
<p><a href="#">hello@bergerfohr.com</a></p>
<p><span>(303) 578-8368</span></p>
</footer>
</div>
</body>
</html>
pc.css
.wrap {
width: 80%;
margin: 0 auto;
padding-top: 80px;
}
.phone {
display: none;
}
.pc li{
line-height: 60px;
font-size: 2rem;
overflow: hidden;
}
.pc li:nth-of-type(1) {
width: 30%;
height: 100%;
float: left;
}
.pc li:nth-of-type(2) {
width: 40%;
height: 100%;
float: left;
text-align: center;
}
.pc li:nth-of-type(2) a{
margin: 0 5px;
}
.pc li:nth-of-type(3) {
width: 30%;
height: 100%;
float: left;
text-align: right;
}
main {
overflow: hidden;
}
main .item {
width: 32%;
float: left;
margin-right: 2%;
}
main .item:nth-of-type(3n) {
margin-right: 0;
}
main .item img {
display: block;
width: 100%;
}
main .item p {
height: 5rem;
line-height: 5rem;
}
footer {
height: 5rem;
}
footer P {
height: 100%;
line-height:5rem ;
float: left;
width: 30%;
}
footer p:nth-of-type(2){
width: 40%;
text-align: center;
}
footer p:nth-of-type(3){
text-align: right;
}
phone.css
.wrap {
width: 92%;
margin: 0 auto;
padding-top: 80px;
}
nav {
width: 92%;
}
.pc {
display: none;
}
.phone {
width: 100%;
height: 60px;
}
.phone li {
width: 50%;
height: 60px;
line-height: 60px;
font-size:2rem ;
float: left;
}
.phone li:nth-of-type(2) a {
float: right;
width: 20px;
height: 20px;
background-image: url(../img/menu.png);
background-size: 100% 100%;
margin-top:20px ;
}
main {
overflow: hidden;
}
main .item {
width: 100%;
}
main .item:nth-of-type(3n) {
margin-right: 0;
}
main .item img {
display: block;
width: 100%;
}
main .item p {
height: 5rem;
line-height: 5rem;
}