目前正在为我的一位朋友创建一个网站,该网站目前使用列网格系统进行移动响应。但是我遇到了一个非常大的问题,因为我在导航栏下面的所有内容似乎都有40px填充(由Firebug显示)导致所有内容都不符合要求。 在浏览我的CSS时,我似乎无法找到这个填充的来源,任何帮助都会非常感激。
body {
background: url("background.jpg");
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
color: white;
font-family: "Times New Roman", Georgia, serif, Helvetica, Arial, sans-serif;
}
.container {
width: 1200px;
}
#header-text {
color: white;
font-family: "Times New Roman", Georgia, serif, Helvetica, Arial, sans-serif;
font-size: 22px;
}
#unforgettable {
font-size: 14px;
font-family: "Times New Roman", Georgia, serif, Helvetica, Arial, sans-serif;
}
#unforgettableH3 {
color: white;
font-family: "Times New Roman", Georgia, serif, Helvetica, Arial, sans-serif;
}
.fa {
color: white;
margin: 0 5px 0 5px;
}
.fa-twitter:hover {
color: #5EA9DD;
margin-right:
}
.fa-facebook:hover {
color: #3B5998;
}
.fa-pinterest:hover {
color: #E0373F;
}
h3 {
color: white;
font-family: "Times New Roman", Georgia, serif, Helvetica, Arial, sans-serif;
background: rgb(183,183,183); /* Old browsers */
background: -moz-linear-gradient(top, rgba(183,183,183,1) 0%, rgba(94,94,94,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(183,183,183,1)), color-stop(100%,rgba(94,94,94,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(183,183,183,1) 0%,rgba(94,94,94,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(183,183,183,1) 0%,rgba(94,94,94,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(183,183,183,1) 0%,rgba(94,94,94,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(183,183,183,1) 0%,rgba(94,94,94,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b7b7b7', endColorstr='#5e5e5e',GradientType=0 ); /* IE6-9 */
width: 100%;
}
ul.rig {
list-style: none;
font-size: 0px;
}
ul.rig li {
display: inline-block;
margin: 0 0 2.5% 2.5%;
padding: 10px;
background: black;
border: 1px solid #ddd;
font-size: 16px;
font-size: 1rem;
vertical-align: top;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
text-align: center;
color: white;
}
ul.rig li img {
max-width: 100%;
height: auto;
margin: 0 0 10px;
}
ul.rig li h3 {
margin: 0 0 5px;
color: white;
font-family: "Times New Roman", Georgia, serif, Helvetica, Arial, sans-serif;
}
ul.rig li p {
font-size: .9em;
line-height: 1.5em;
color: #999;
}
/* class for 2 columns */
ul.rig.columns-1 li {
width: 97.5%; /* this value + 2.5 should = 100% */
}
/* class for 2 columns */
ul.rig.columns-2 li {
width: 47.5%; /* this value + 2.5 should = 50% */
}
/* class for 3 columns */
ul.rig.columns-3 li {
width: 30.83%; /* this value + 2.5 should = 33% */
}
/* class for 4 columns */
ul.rig.columns-4 li {
width: 22.5%; /* this value + 2.5 should = 25% */
}
.list-center {
list-style: outside none none;
margin-left: -5px;
padding-left: 0;
}
.list-center > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
.navbar .sub-menu:before {
border-bottom: 7px solid transparent;
border-left: none;
border-right: 7px solid rgba(0, 0, 0, 0.2);
border-top: 7px solid transparent;
left: -7px;
top: 10px;
}
.navbar .sub-menu:after {
border-top: 6px solid transparent;
border-left: none;
border-right: 6px solid #fff;
border-bottom: 6px solid transparent;
left: 10px;
top: 11px;
left: -6px;
}
@media (max-width: 1199px) {
.container {
width: auto;
padding: 0 10px;
}
}
@media (max-width: 480px) {
ul.grid-nav li {
display: block;
margin: 0 0 5px;
}
ul.grid-nav li a {
display: block;
}
ul.rig {
margin-left: 0;
}
ul.rig li {
width: 100% !important; /* over-ride all li styles */
margin: 0 0 20px;
}
}
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
}
/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) {
/* Styles */
}
/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
/* Styles */
}
/* iPads (landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
/* Styles */
}
/* iPads (portrait) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
/* Styles */
}
/**********
iPad 3
**********/
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
/* Desktops and laptops ----------- */
@media only screen and (min-width : 1224px) {
/* Styles */
}
/* Large screens ----------- */
@media only screen and (min-width : 1824px) {
/* Styles */
}
/* iPhone 4 ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
}
/* iPhone 5 ----------- */
@media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
@media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
/* iPhone 6 ----------- */
@media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
@media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
/* iPhone 6+ ----------- */
@media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
@media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
/* Samsung Galaxy S3 ----------- */
@media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
@media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){
/* Styles */
}
/* Samsung Galaxy S4 ----------- */
@media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 3){
/* Styles */
}
@media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 3){
/* Styles */
}
/* Samsung Galaxy S5 ----------- */
@media only screen and (min-device-width: 360px) and (max-device-height: 640px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 3){
/* Styles */
}
@media only screen and (min-device-width: 360px) and (max-device-height: 640px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 3){
/* Styles */
}