[英]Toggle div base on body class when body class is “ ”
I am using discourse.org to set up a company forum and therefore have limited access to the site's html code. 我正在使用discourse.org设立公司论坛,因此对网站的html代码的访问受到限制。 I have some after header content I only want to show on the landing page.
我只想在目标网页上显示一些标题后的内容。
Right now I can create content that is specific to all the other subpages using the body class like this: 现在,我可以使用body类创建特定于所有其他子页面的内容,如下所示:
.showthisdiv {display:block;}
body.subpageclass1 .showthisdiv {display:none;}
This won't work for the landing page however because the landing page body class name is blank like this: 但是,这对于目标网页不起作用,因为目标网页正文类名称为空白,如下所示:
<body class=""> ...
How do I declare a class in css when the body class is blank? 当body类为空时,如何在CSS中声明类? Does anyone know a way around this?
有谁知道解决这个问题的方法吗? I have been searching for the last day or so, but cannot find it.
我一直在寻找最后一天,但找不到它。
What about: 关于什么:
body[class=""] {
color: red;
}
您可以使用以下选择器: body[class=""]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.