简体   繁体   English

如何防止我的英雄区域中的文本为移动用户溢出?

[英]How do I prevent the text from my hero area from overflowing for mobile users?

I'm customising a wordpress theme ( Impact ) but the header / hero area size is not working for my site (text box gets pushed down and is hidden in the overflow area below).我正在自定义 wordpress 主题(影响),但 header / hero 区域大小不适用于我的站点(文本框被推下并隐藏在下面的溢出区域中)。

This is one of the problematic pages: https://better.sg/content/interview-jonathan-tan-jerry-lim-contribute-sg/这是有问题的页面之一: https://better.sg/content/interview-jonathan-tan-jerry-lim-contribute-sg/

I have a hero image with a text box on top that uses CSS and JS.我有一个顶部带有文本框的英雄图像,它使用 CSS 和 JS。 The size of the hero image (which I set using VH) and the position of the text box (which adjusts on load due to a javascript) cause the text box to be positioned too low for some mobile users.英雄图像的大小(我使用 VH 设置)和文本框的 position(由于 javascript 会在加载时进行调整)导致文本框的位置对于某些移动用户来说太低了。 I am not sure how to fix this.我不知道如何解决这个问题。 What is causing the text box to be pushed below the hero area and how do I either (a) adjust the hero image size to account for longer titles or (b) make sure the text title does not adjust down below the bottom of the hero image?是什么导致文本框被推到英雄区域下方,我该如何(a)调整英雄图像大小以适应更长的标题或(b)确保文本标题不会向下调整到英雄底部以下图片?

The style sheet is here: https://better.sg/wp-content/themes/Impact/css/style.css And my init.js is here: https://better.sg/wp-content/themes/Impact/js/init.js (not sure if this is the one causing the problem). The style sheet is here: https://better.sg/wp-content/themes/Impact/css/style.css And my init.js is here: https://better.sg/wp-content/themes/Impact /js/init.js (不确定这是否是导致问题的原因)。

I'm having trouble debugging, so any advice is appreciated!我在调试时遇到了麻烦,所以任何建议都值得赞赏! Thanks!谢谢!

Go to your WordPress website open click on Themes and then select Customize. Go 到您的 WordPress 网站打开点击主题然后 select 自定义。 In Customize select additional CSS and add the following code and save it.在自定义 select 中附加 CSS 并添加以下代码并保存。

@media(max-width:768px){
     #single-page-slider{
          height:auto;
       }
       #single-page-slider .item-active .container .gap{
           width:80%;
        }
}

You could use @media rules in CSS ( link ) to reduce the size of your header images on smaller screen sizes您可以在 CSS (链接) 中使用@media规则来减小 header 图像在较小屏幕尺寸上的大小

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM