为什么做出来的效果图不能居中
nav {
background: #ccc;
height: 50px;
}
#banner {
background: #777;
height: 700px;
}
nav ul {
list-style: none;
margin: 0;
float: right;
}
nav ul li, nav.logo {
display: inline-block;
line-height: 50px;
margin-right: 20px;
}
nav ul li a {
line-height: inherit;
text-decoration: none;
display: inline-block;
height: inherit;
color: #fff;
}
#banner .inner {
max-width: 300px;
text-align: center;
margin: 0 auto;
position: relative;
top: 160px;
}
#banner .inner h1 {
margin: 0;
}
button {
border: none;
background: #333;
color: #eee;
padding: 10px;
}
#banner button {
padding: 14px 60px;
}
#banner .inner .more {
margin-top: 280px;
}
.sub-heading {
line-height: 30px;
margin: 30px 0;
}
.logo {
font-size: 20px;
font-weight: 700;
letter-spacing: 1px;
float: left;
padding: 10px;
}
.logo a {
color: #fff;
text-decoration: none;
}
.active {
border-bottom: 4px solid #fff;
}
h1 {
padding: 12px;
border-top: 2px solid #fff;
border-bottom: 2px solid #fff;
}
h2 {
font-size: 30px;
}
#main-btn {
padding: 14px 28px;
font-size: 20px;
letter-spacing: 4px;
border-radius: 6px;
background: #18a;
}
.green-section {
background: #089DB0;
color: #fff;
text-align: center;
padding: 100px 0;
}
.green-section .hr {
background: #078494;
width: 60%;
}
.wrapper {
max-width: 1080px;
}
.hr {
width: 100%;
height: 2px;
margin: 0 auto;
margin: 20px auto;
}
wrapper hr .sub-heading {
font-size: 18px;
}
.green-section .icon-group .icon {
display: inline-block;
width: 80px;
height: 80px;
border: 1px solid #0D6F7C;
transform: rotate(45deg);
margin: 20px;
}
.icon-group {
margin-top: 60PX;
}
.gray-section {
background: #252f34;
color: #fff;
}
.gray-section .img-section {
width: 45%;
}
.img-section img {
width: 100%;
}
.gray-section .text-section {
width: 55%;
}
.article-preview > div {
float: left;
font-size: 0;
}
.article-preview:nth-child(odd) {
background-color: rgba(255,255,255,0.05);
}
.article-preview:after {
content: '';
display: block;
clear: both;
}
.text-section {
position: relative;
top: 68px;
left: 50px;
}
.text-section h2 {
margin-bottom: 20px;
}
.text-section p {
font-size: 18px;
letter-spacing: 1px;
}
.text-section .sub-heading {
font-size: 22px;
margin-top: 0;
}
.text-section > * {
max-width: 98%;
}
.purple-section {
padding: 80px;
background: #3f3965;
color: #fff;
}
.purple-section .heading-wrapper {
text-align: center;
}
.purple-section .hr {
background: #373259;
width: 60%;
}
.card {
float: left;
width: 50%;
min-height: 300px;
padding: 50px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
/*border:1px solid white;*/
}
.clearfix:after {
content: '';
display: block;
clear: both;
}
.h3{
font-size:24px;
}
p{
font-size:18px;
letter-spacing:1px;
}
.card:first-child{
background:rgba(0,0,0,0.05);
}
.card:nth-child(2){
background:rgba(0,0,0,0.09);
}
.card:nth-child(3){
background:rgba(0,0,0,0.09);
}