You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何彻底移除Odoo10社区版的完整页脚?

彻底移除Odoo 10社区版完整页脚的解决方案

你当前的代码仅通过display: none隐藏了页脚内容,但页脚的父容器或关联元素仍保留默认边距、内边距等样式,导致页面仍有空白区域。以下是两种彻底移除页脚的可靠方法:

方法一:通过模板继承直接移除页脚结构

Odoo 10的页面核心布局模板为website.layout,可直接定位到页脚节点并完全移除:

<template id="full_footer_remove" inherit_id="website.layout">
    <!-- 定位页面footer标签,直接替换为空内容以彻底移除 -->
    <xpath expr="//footer" position="replace">
    </xpath>
</template>

若你的主题中页脚嵌套在div#footer的父容器内,可调整xpath定位范围:

<template id="full_footer_remove" inherit_id="website.layout">
    <xpath expr="//div[@id='footer']/.." position="replace">
    </xpath>
</template>
> 注:`position="replace"`会将目标节点及所有子内容替换为空,从根源移除页脚结构。

方法二:自定义CSS清除页脚及占位样式

若模板继承方式不生效(如使用第三方主题),可在网站设置 > 网站 > 自定义 > CSS/JS中添加以下代码:

/* 清除所有页脚相关元素及占位样式 */
footer,
#footer,
.footer-container,
.o_footer {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

验证步骤

  1. 升级并应用自定义模块(若使用模块实现)
  2. 清除浏览器缓存与Odoo模板缓存
  3. 刷新页面确认效果

内容的提问来源于stack exchange,提问作者code_explorer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 08:36:25