Html 所有元素中的随机40px填充

Html 所有元素中的随机40px填充,html,css,padding,Html,Css,Padding,目前正在为我的一位朋友制作一个网站,该网站使用柱网系统实现移动响应,迄今为止进展顺利。然而,我有一个非常大的问题,在导航栏下面的所有内容似乎都有一个由Firebug显示的40px的填充,导致所有内容都不符合要求。 当查看我的CSS时,我似乎找不到这个填充的来源,任何帮助都将不胜感激 body { background: url("background.jpg"); -webkit-background-size: cover; -moz-background-size

目前正在为我的一位朋友制作一个网站,该网站使用柱网系统实现移动响应,迄今为止进展顺利。然而,我有一个非常大的问题,在导航栏下面的所有内容似乎都有一个由Firebug显示的40px的填充,导致所有内容都不符合要求。 当查看我的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 */
}    

FireBug还应该向您显示元素的附加类以及哪些类赋予它填充。你可以检查一下,确定哪个类添加了多余的填充。很难用你给我们的进行调试。你能用提琴或密码笔创造一个新的世界吗?这是在什么设备/浏览器上发生的?@LcLk该网站目前位于adamfenwickweb.co.uk。我曾尝试放置一个整体CSS块,删除40px填充,这确实改善了情况,但仍然不理想。钻机本身是不相称的。你使用的是a吗?而且,你有很多冗余。例如,字体系列只需要在正文选择器下。@ZachCB我没有使用任何形式的重置,目前唯一的代码是其中的代码,但是我已经删除了添加的字体系列。如果我将填充设置为左:0px;在CSS中,这个问题被减少了,在整个容器和每个框/列之间创建了一个较小的间隙,但是它仍然按照容器的右侧进行修复。