gpt4 book ai didi

一页 wordpress 侧边栏的 CSS 特定规则

转载 作者:太空宇宙 更新时间:2023-11-04 05:21:45 25 4
gpt4 key购买 nike

嘿,我有一个 wordpress 博客,我需要在索引页的侧边栏上添加一些负边距,但不是在任何其他页面上,问题是因为侧边栏在“sidebar.php”和 head 元素中位于“header.php”中,因此我不能仅针对该页面使用内联样式或样式。

有什么方法可以实现吗?

我假设标题中有一个 PHP if 语句?

目前我在正文中使用了样式元素。

最佳答案

我有一段时间没有使用 wordpress,但据我所知,有一个特定的主页/索引模板...您可以将侧边栏包装在一个标签中,然后通过 css 对其进行子引用。

CSS:

#sidebar-fix #sidebar element {...}

html:

<div id="sidebar-fix"><?#sidebar include?></div>

关于一页 wordpress 侧边栏的 CSS 特定规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6414845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com