如何摆脱网站页面底部的大空白?

问题描述 投票:0回答:1

我使用货物,我的网站在页脚下方所有页面的底部都有一个大的空白区域。我查看了CSS,发现没有输入页脚。我尝试根据网上找到的一些有类似问题的解决方案自行输入,例如:

#footer .content p {
    margin-bottom: 0
}

或者尝试高度,但都不起作用。

请帮助我了解我应该做什么来解决这个问题。谢谢!

下面是完整的 CSS 代码:

#toolset {
    display: none;
}

body {
    background-color: #fff;
    color: #000;
}

a:active {
    opacity: 0.7;
}

.page a.active {
    opacity: .4;
}

i,
em {
    font-style: italic;
}

b,
strong {
    font-weight: bolder;
}

sub,
sup {
    position: relative;
    vertical-align: baseline;
}

sub {
    top: 0.3em;
}

sup {
    top: -0.4em;
}

s {
    text-decoration: line-through;
}

img {
    border: 0;
    padding: 0;
}

ul,
ol {
    margin: 0;
    padding: 0 0 0 2.5em;
}

blockquote {
    margin: 0;
    padding: 0 0 0 2em;
}

hr {
    background: rgba(0, 0, 0, 0.4);
    border: 0;
    height: 1px;
    display: block;
    margin-bottom: 0rem;
}

.content img {
    float: none;
    margin-bottom: .5em;
}

.gallery_image_caption {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
    font-family: "Monument Grotesk Semi-Mono", Icons;
    font-style: normal;
    line-height: 1.2;   
}

/**
 * Loading Animation
 */

.loading[data-loading] {
    position: fixed;
    bottom: 8px; 
    left: 8px;
}

/**
 * Editor styles
 */

[data-predefined-style="true"] bodycopy {
    font-size: 1.3rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
    font-family: "Diatype Variable", Icons;
    font-style: normal;
    line-height: 1.2;
    font-variation-settings: 'slnt' 0, 'MONO' 0;
}

[data-predefined-style="true"] bodycopy a {
    color: rgba(0, 0, 0, 0.85);
    text-decoration: none;
}

[data-predefined-style="true"] bodycopy a:hover {

}

bodycopy a.image-link,
bodycopy a.icon-link,
bodycopy a.image-link:hover,
bodycopy a.icon-link:hover {
    border-bottom: 0;
    padding-bottom: 0;
}

[data-predefined-style="true"] h1 {
    font-family: "Routed Gothic Wide", Icons;
    font-style: normal;
    font-weight: 400;
    padding: 0;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.8;
    color: rgba(0, 0, 0, 0.85);
    letter-spacing: -0.04rem;
    }

[data-predefined-style="true"] h1 a {
    border: 0;
    color: rgba(0, 0, 0, 0.85);
}

[data-predefined-style="true"] h2 {
    font-family: "Routed Gothic Wide", Icons;
    font-style: normal;
    font-weight: 400;
    padding: 0;
    margin: 0;
    color: rgba(0, 0, 0, 0.88);
    font-size: 1.7rem;
    line-height: 2;
    }

[data-predefined-style="true"] h2 a {
    border: 0;
    color: rgba(0, 0, 0, 0.85);
}

[data-predefined-style="true"] small {
    display: inline-block;
    font-size: 1rem;
    line-height: 1.4;
    font-family: "Routed Gothic", Icons;
    font-style: normal;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
    letter-spacing: 0.05em;
}

[data-predefined-style="true"] small a {
    border: 0;
    color: rgb(0, 0, 0);
}

/**
 * Breakpoints
 */


[data-css-preset] .page {
    background-color: initial /*!page_bgcolor*/;
}

.mobile .page,
[data-css-preset].mobile .page {
    position: relative;
    min-height: 10px;
    max-width: 100%;
    width: 100%;
    background-color: transparent /*!page_bgcolor*/;
}

[data-css-preset] .container {
    margin-left: auto /*!content_center*/;
    margin-right: auto /*!content_center*/;
    text-align: center /*!text_center*/;
}

[data-css-preset] body {
    background-color: rgb(255, 255, 255) /*!body_bgcolor*/;
}

[data-css-preset] .container_width {
    width: 100%/*!content_center*/;
}

[data-css-preset] .content_padding {
    padding-top: 1.3rem /*!main_margin*/;
    padding-bottom: 1.3rem /*!main_margin*/;
    padding-left: 1.3rem /*!main_margin*/;
    padding-right: 1.3rem /*!main_margin*/;
}


[data-css-preset] text-limit {
    display: inline-block /*!text_width*/;
    max-width: 66rem/*!text_width*/;
}

/**
 * Thumbnails
 */

div[thumbnails] {
    justify-content: flex-start;
}

[data-css-preset] .thumbnails {
    background-color: transparent/*!thumbnails_bgcolor*/;   
}

[data-css-preset] .thumbnails_width {
    width: 100%/*!thumbnails_width*/;
}

[data-css-preset] [thumbnails-pad] {
    padding: 0.75rem/*!thumbnails_padding*/;
}

[data-css-preset] [thumbnails-gutter] {
    margin: -1.5rem/*!thumbnails_padding*/;
}

[data-css-preset] [responsive-layout] [thumbnails-pad] {
    padding: 0.275rem/*!responsive_thumbnails_padding*/; 
}

[data-css-preset] [responsive-layout] [thumbnails-gutter] {
    margin: -0.55rem/*!responsive_thumbnails_padding*/; 
}

.thumbnails .thumb_image {
    outline: 0px solid rgba(0,0,0,.12);
    outline-offset: -1px;
}

.thumbnails .title {
    margin-top: 1.2rem;
    margin-bottom: .3rem;
    font-size: 1.3rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
    font-family: Diatype, Icons;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.thumbnails .tags {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
    font-family: "Monument Grotesk Semi-Mono", Icons;
    font-style: normal;
    line-height: 1.2;
}

.thumbnails .tags a {
    border-bottom: 0;
    color: rgba(0, 0, 0, 0.85);
    text-decoration: none;
}

.thumbnails .has_title .tags {
    margin-top: 0rem;
}

/**
 * Site Menu Button
 */

[data-css-preset] #site_menu_button {
    color: rgba(0, 0, 0, 0.75);
    line-height: 1;
    font-size: 28px /*!site_menu_button*/;
    padding: 11px;
    line-height: 1;
    background: rgba(33, 32, 46, 0);
    position: fixed;
    top: 3rem /*!site_menu_button*/;
    right: 3rem /*!site_menu_button*/;
}

body.mobile #site_menu_button {
    margin: -10px;
    font-size: 28px;
}

#site_menu_button.custom_icon {
    width: 40px;
    height: auto;
}

#site_menu_button.active {
    display: none;
}

/**
 * Site Menu
 */

#site_menu {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif, "Sans Serif", Icons;
    background: rgba(20, 20, 20, 0.95);
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    padding: 20px 30px 90px 30px;
    max-width: 400px;
    min-width: 300px;
    text-align: left;
    display: flex;
    justify-content: flex-start;
}

body.mobile #site_menu {
    width: 100%;
}

#site_menu .page-link a {
    color: rgba(255, 255, 255, 0.75);
}

#site_menu .set-link > a {
    color: rgba(255, 255, 255, 0.75);
    font-weight: bold;
}

#site_menu a:active {
    opacity: .7;
}

#site_menu a.active {
    opacity: .4;
}

#site_menu .close {
    display: none;
    color: rgba(255, 255, 255, 0.4);
    line-height: .85em;
    font-size: 45px;
}

body.mobile #site_menu .close {
    display: block;
    font-size: 50px;
    line-height: 1em;
}

#site_menu .break {
    height: 28px;
}

#site_menu .indent {
    margin-left: 28px;
}

/*
 * Shop Button
 */

[data-css-preset] #shop_button {
    color: rgba(0, 0, 0, 0.85);
    background: transparent;
    font-size: 32px;
    font-style: normal;
    font-weight: 400;
    line-height: 1;
    position: fixed;
    padding: 6px;
    top: 2rem /*!shop_button*/;
    right: 2rem /*!shop_button*/;
}

#shop_button.text {
    font-family: Diatype, Icons;
    font-size: 1.3rem;
    padding: 0;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
    font-style: normal;
}

#shop_button.custom_icon {
    width: 40px;
    height: auto;
}

body.mobile #shop_button:not(.text) {
    margin: -6px;
    font-size: 36px;
}

/*
 * Shop Product Widget
 */

.shop_product {
    width: 100%;
    max-width: 22rem;
    position: relative;
    display: block;
}

.shop_product .price {
    font-family: Diatype, Icons;
    font-size: 1.3rem;
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.85);
    display: block;
    margin-bottom: 1rem;
    font-style: normal;
    font-weight: 500;
}

.shop_product .dropdown {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif, "Sans Serif", Icons;
    font-size: 1.3rem;
    display: inline-block;
    width: 100%;
    border: 1px solid rgba(0,0,0,.2);
    background:  white url(https://static.cargo.site/assets/images/select-line-arrows.svg) no-repeat right;
    margin-bottom: 1rem;
    line-height: 1.4;
    padding: .7rem 3rem 0.8rem 1rem;
    font-style: normal;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
}

.shop_product .button {
    font-family: Diatype, Icons;
    font-size: 1.3rem;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255,255,255,1);
    flex: 0 0 50%;
    text-align: left;
    display: inline-block;
    line-height: 1.3;
    padding: .8rem 1rem;
    font-style: normal;
    font-weight: 500;
}

/*
 * Image Zoom
 */

.content img.image-zoom:active {
  opacity: .7;
}

/**
 * Quick View
 */

[data-css-preset] .quick-view {
    padding-top: 2.5rem /*!quick_view_padding*/;
    padding-bottom: 2.5rem /*!quick_view_padding*/;
    padding-left: 2.5rem /*!quick_view_padding*/;
    padding-right: 2.5rem /*!quick_view_padding*/;
    height: 98% /*!quick_view_height*/;
    width: 100% /*!quick_view_width*/;
}

body.mobile .quick-view {
    width: 100%;
    height: 100%;
    margin: 0;
}

[data-css-preset] .quick-view-background {
    background: rgb(255, 255, 255) /*!quick_view_bgcolor*/;
}

.quick-view-caption {
    font-family: "Monument Grotesk Semi-Mono", Icons;
    transition: 100ms opacity ease-in-out;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 3.5rem 0;
    text-align: center;
    font-size: 1.1rem;
    font-style: normal;
    font-weight: 400;
}

.quick-view-caption span {
    padding: 0.5rem 1rem;
    display: inline-block;
    background: rgba(0,0,0,0.5);
    color: white;
}


/**
 * Quick View Navigation 
 */

.quick-view-navigation .left-arrow {
    left: 10px;
}

.quick-view-navigation .right-arrow {
    right: 10px;
}

.quick-view-navigation .left-arrow,
.quick-view-navigation .right-arrow {
    /* Change height/width together to scale */
    height: 36px;
    width: 36px;
}

.quick-view-navigation .left-arrow .inner-color,
.quick-view-navigation .right-arrow .inner-color {
    stroke: #fff;
    stroke-width: 0px;
}

.quick-view-navigation .left-arrow .outer-color,
.quick-view-navigation .right-arrow .outer-color {
    stroke: rgba(0, 0, 0, 0.85);
    stroke-width: 2px;
}

.quick-view-navigation .close-button {  
    top: 10px;
    right: 10px;
    /* Change height/width together to scale */
    width: 36px;
    height: 36px;
}

.quick-view-navigation .close-button .inner-color {
    stroke: #fff;
    stroke-width: 0px;
}

.quick-view-navigation .close-button .outer-color {
    stroke: rgba(0, 0, 0, 0.85);
    stroke-width: 2px;
}

/** 
 * Image Gallery Navigation Arrows 
 */
 
.image-gallery-navigation .left-arrow,
.image-gallery-navigation .right-arrow {
    /* Change height/width together to scale */
    height: 36px;
    width: 36px;
}

.image-gallery-navigation .left-arrow .inner-color,
.image-gallery-navigation .right-arrow .inner-color {
    stroke: rgba(255, 255, 255, 1);
    stroke-width: 1.5px;
}

.image-gallery-navigation .left-arrow .outer-color,
.image-gallery-navigation .right-arrow .outer-color {
    stroke: rgba(0, 0, 0, 0.6);
    stroke-width: 2.5px;
}

/**
 * Wallpaper Backdrop Navigation Arrows 
 */

.wallpaper-navigation .left-arrow,
.wallpaper-navigation .right-arrow {
   /* Change height/width together to scale */
   width: 36px;
   height: 36px;
}

.wallpaper-navigation .left-arrow .inner-color,
.wallpaper-navigation .right-arrow .inner-color {
   stroke: rgba(255, 255, 255, 1);
   stroke-width: 1.5px;
}

.wallpaper-navigation .left-arrow .outer-color,
.wallpaper-navigation .right-arrow .outer-color {
    stroke: rgba(0, 0, 0, 0.6);
    stroke-width: 2.5px;
}


/**
 * Feed
 */

.feed .content_container .page {
    border-top: 0px dashed rgba(0, 0, 0, 0.2);
}

.feed .content_container .page_container:first-child .page {
    border-top: 0;
}


/*
 * Audio Player
 */

.audio-player {
    max-width: 36rem;
    height: 3.3rem;
    outline: 1px solid rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.85);
    background: #fff;
    font-size: 1.2rem;
    line-height: 1.4;
    font-family: Diatype, Icons;
    font-style: normal;
    font-weight: 500;
    text-align: left;
    margin: 1px 1px 1em 1px;
}

body.mobile .audio-player {
    max-width: 100%;
}

.audio-player .separator {
    width: 1px;
    background-color: rgba(0,0,0,0.15);
}

.audio-player .button {
    background: transparent;
    cursor: pointer;
    fill: rgba(0, 0, 0, 0.85);
}

.audio-player .icon {
    fill: rgba(0, 0, 0, 0.85);
    padding: 30%;
    width: 100%;
    margin: auto;
}

.audio-player .buffer {
    background: rgba(0,0,0,0.03);
}

.audio-player .progress {
    background: rgba(0,0,0,0.1);
}

.audio-player .progress-indicator {
    border: 1px solid rgba(0, 0, 0, 0.7);
    width: 1px;
    height: 100%;
    right: 0;
    position: absolute;
    cursor: ew-resize;
}

.audio-player .note-icon {
    height: 100%;
    width: 3.8rem;
    padding: 1rem;
    fill: rgba(0, 0, 0, 0.5);
}

.audio-player .current-time {
    padding-left: 1rem;
}

.audio-player .total-time {
    padding-right: 1rem;
}

[data-css-preset] .container {
    text-align: left /*!text_left*/;
}

html whitespace removing-whitespace cargo
1个回答
0
投票

页脚或其子元素可能有给定的高度。或者可能存在与页脚元素关联的边距或填充。您能分享页脚的 html 部分吗?这样我就可以关联并检查创建空白的确切错误是什么。

以下是可能的错误列表: a) 页脚或其子元素中的底部边距或填充,甚至可能位于主体元素中。

b) 高度可能会产生空白

c) 可能是由于某种溢出造成的。

因此,正如之前所写,请分享 html 部分的屏幕截图或代码,以便我可以检查并提供重点答案

© www.soinside.com 2019 - 2024. All rights reserved.