Wordpress。仅修改主页的css [英] Wordpress. Modify the css only for the homepage

查看:463
本文介绍了Wordpress。仅修改主页的css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆