我尝试使用此代码在 Wordpress 中仅显示特定页面 #content 但无法正常工作...
body.page-id-2 .masthead-fixed .site-main {
display: none;
}
这是网站:
http://avocat.dac-proiect.ro/wp/
我在网上搜索过,我看到例子可以做到,但我不工作
我哪里错了?
提前致谢!
最佳答案
.page-id-2
和 .masthead-fixed
在您的 html 中处于同一级别,因此您必须像这样:
body.page-id-2.masthead-fixed .site-main {
display: none;
}
或完全删除 .masthead-fixed
选择器:
body.page-id-2 .site-main {
display: none;
}
关于html - 仅在页面上显示内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28474999/