我继续对容器(即outer-container
)进行额外的填充,我什至没有在CSS上这样声明:
填充自动声明为232px。但是我的CSS上没有:
@media only screen and (max-width: 600px) {
.outer-container {padding: 0;}
}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 601px) {
.outer-container {padding: 0;}
}
@media only screen and (min-width: 700px) {
.outer-container {padding: 1px;}
}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 800px) {
.outer-container {padding: 1px;}
}
/* Large devices (laptops/desktops, 900px and up) */
@media only screen and (min-width: 900px) {
.outer-container {padding: 0 14.5em;}
}
@media only screen and (min-width: 1000px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 1100px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 1200px) {
.outer-container {padding: 0 39em;}
}
@media only screen and (min-width: 1300px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 1400px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 1500px) {
.outer-container {padding: 0 37em;}
}
/* Extra large devices (large laptops and desktops, 1600px and up) */
@media only screen and (min-width: 1600px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 1700px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 1800px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 1900px) {
.outer-container {padding: 0 37em;}
}
@media only screen and (min-width: 2000px) {
.outer-container {padding: 0 37em;}
}
.container {
padding: 0em;
border-top: 0;
border-bottom: 0;
border-style: solid;
text-align: left;
/* box-shadow: 0px 5px 15px 0px; */
position: relative;
overflow: auto;
}
#bk-img {
background: url(../img/bk-img.jpg) no-repeat center center fixed;
background-size: cover;
}
如您所见,当将padding: 0
和padding: 1px
调整为600-800px时,我尝试将它们放在代码上,但这并不好。我该怎么办?