【问题标题】:Fixed text move up when footer appears using wordpress theme修复了使用 wordpress 主题出现页脚时文本向上移动的问题
【发布时间】:2022-01-17 15:49:28
【问题描述】:

我正在使用一个名为“Lay Theme”的 wordpress 模板,我希望将信息文本固定在我的网站左侧。我使用 position:fixed 对其进行了修复,但是当我向下滚动并且文本比其他文本稍长时,它会覆盖页脚。 我希望在出现 te 页脚时文本向上移动,我该如何解决这个问题?

我为 text-div 指定了“uitleg”类(荷兰语)

示例如下:https://www.zwtsr.nl/housenation-x-ade/

.uitleg position: fixed; top: 45%; }

【问题讨论】:

    标签: css wordpress themes fixed sticky


    【解决方案1】:

    尝试使用“位置:粘性;”

    .container {
        width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
    .content {
        height: 2000px;
    }
    .content .text {
        width: 50%;
        position: sticky;
        top: 50%;
    }
    footer {
        width: 100%;
        height: 1080px;
        color: #fff;
        box-sizing: border-box;
        padding: 40px;
        background: #212121;
    }
    <div class="container">
      <div class="content">
        <div class="text">
          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
        </div>
      </div>
    </div>
    <footer>
      footer
    </footer>

    【讨论】:

    • 您好,谢谢您的回答!如何在我的网站代码中添加它?当我把它放在自定义 css 中时,什么也没有发生..
    • @Jesse 尝试:.uitleg 位置:粘性;最高:45%;如果您有两个主要 div,一个用于放置文本,另一个用于放置例如照片(均为 50% 宽),在主 div 中放置一个带有“.uitleg”类的 div 用于文本。例如

    猜你喜欢
    • 1970-01-01
    • 2016-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多