简体   繁体   English

Shopify 单 Static 部分填充页?

[英]Shopify Single Static Section Fill Page?

When using a single section in Shopify how can you grow the div to fill the whole screen?在 Shopify 中使用单个部分时,如何使 div 增长以填满整个屏幕?

I have modified the theme.scss file and added a class我修改了theme.scss file并添加了一个class

.hero--dsfull {
  height: 100%;
}

Butt the section needs to FILL the window not just the div it is in.对接部分需要填充 window 而不仅仅是它所在的div

See Example: https://bunc.bike/pages/test参见示例: https://bunc.bike/pages/test

Screenshot showing white space to be removed显示要删除的空白的屏幕截图

I came across a potential solution but I do not know how to implement it: Full height sections single page我遇到了一个潜在的解决方案,但我不知道如何实现它: 全高部分单页

If you want to that /pages/test page only then do like this.如果你只想到那个/pages/test页面,那么就这样做。

<div class="page-container {% if page.url == '/pages/test' %}full-height{% endif %}" id="PageContainer"></div>

Add below SCSS code in your theme.scss.liquid file在您的theme.scss.liquid文件中添加以下SCSS代码

.page-container{
    &.full-height{
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 100vh;
    }
}

OR或者

Add below code in template.liquid or page.liquid file.template.liquidpage.liquid文件中添加以下代码。

{% if page.url == '/pages/test' %}
<style type="text/css">
    .page-container{
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 100vh;
    }
</style>
{% endif %}

This solution for specific page based on page.url not for global/all-pages solution.此基于page.url的特定page解决方案不适用于全局/所有页面解决方案。

在此处输入图像描述

Hope this will help you!希望对你有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不同页面上的Shopify帮助辅助博客部分 - Shopify Help Secondary Blog Section on a different page 在产品页面上显示单个产品图像 shopify - Display a single product image on product page shopify Shopify页面中的自定义div设置为100%宽度,但不会填充容器 - Custom div in Shopify Page is Set to 100% Width, but Will Not Fill Container 在一个部分中水平和垂直居中一个div,并在滚动时使每个部分填满整个页面 - Center horizontally and vertically a div in a section and make each section fill the whole page when scrolling 在单个页面的不同部分标签上应用不同的CSS样式文件 - Apply different css style file on different section tags on single page 基于当前位置的单页隐藏/显示部分 - Single page hide/show section based on current position 在单页网站中更改部分时更改导航背景 - Change background of navigation on change of section in single page website 单滚动显示全页视图移至下一部分 - Full page view on single scroll move to next section HTML单页应用程序,用浏览器填写用户名和密码 - HTML Single Page Application, fill username and passwords with browser Bootstrap 3-在静态页眉和页脚之间填充页面容器(填充宽度和高度) - Bootstrap 3 - Fill page container (Fill width and height ) in between a static header and footer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM