Wordpress。仅修改主页的css [英] Wordpress. Modify the css only for the homepage
问题描述
我安装了wordpress 3.7。在主页上,这是一个静态页面,我已经包括幻灯片。为了最好的观看,应该删除我的主题的global.css文件中的填充。
#content #respond {
padding :1em;
}
问题是,通过删除#内容中的填充,我将其从所有其他页面,这不是很好。
如何获得#内容,而不填充只在家?
感谢
转到您的主页,查看源代码
寻找开头的body标签,例如
< body class =page-template-home >
然后在您css写
.page-template-home #content #respond {
padding:1em;
}
EDIT
< body class =home page page-id-2 page-template-default logged-in chrome alt-style-blue layout-full has-lightbox>
因此在您的css中写下列
.home #content #respond {
padding:1em;
}
这应该适合你。
另一种选择是写
.page-id-2 #content #respond {
padding:1em;
}
I installed wordpress 3.7. On the home page, which is a static page, I have included a slideshow. For best viewing should remove padding in the global.css file of my theme.
#content #respond {
padding: 1em;
}
The problem is that by removing the padding on # content, I remove it from all the other pages and this is not good.
How do I get the # content without padding only on the home? thanks
go to your home page , view the source
look for the opening body tag, for something like
<body class="page-template-home">
then in you css write
.page-template-home #content #respond {
padding: 1em;
}
EDIT
you said you have this for body tag on home page in comment
<body class="home page page-id-2 page-template-default logged-in chrome alt-style-blue layout-full has-lightbox">
So in your css write the following
.home #content #respond {
padding: 1em;
}
That should work for you.
another option would be to write
.page-id-2 #content #respond {
padding: 1em;
}
这篇关于Wordpress。仅修改主页的css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!