仅在页面上显示内容

时间:2015-02-12 10:26:42

标签: html css wordpress

我尝试使用此代码在Wordpress中仅显示特定页面#content但不能正常工作...

body.page-id-2 .masthead-fixed .site-main {
display: none;
}

这是网站:

http://avocat.dac-proiect.ro/wp/

我搜索了互联网,我看到示例可以做到,但我不工作

我某处错了?

提前致谢!

2 个答案:

答案 0 :(得分:0)

你想要隐藏所有这些元素吗?

body.page-id-2, 
.masthead-fixed, 
.site-main {
    display: none;
}

答案 1 :(得分:0)

.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;
}
相关问题