我试图在移动wordpress页面上更改特定帖子的背景。
@media screen and (max-width: 940px)
#page {
max-width: 768px;
width: 100%;
margin: 0 auto;
background: #007A52;
box-shadow: 0 0 10px #999;
}
我知道页面ID已被使用,但我不确定如何?
答案 0 :(得分:0)
http://www.thedoughbros.ie/wp-content/plugins/contact-form-7/includes/css/styles.css
上面的文件对于某些帖子具有以下CSS和自定义背景。
806表示post-id,因此如果您想要自定义背景,请继续添加具有不同ID的新块
@media screen and (max-width: 940px) page.custom-background.page-id-806
/*--------------------------------------------------------------
Custom Backgrounds
--------------------------------------------------------------*/
body.custom-background.page-id-806 {
background-image: url( http://www.thedoughbros.ie/wp-content/uploads/2015/05/menubackground.fw_.png);
}
body.custom-background.page-id-723 {
background-image: url(http://thedoughbros.ie/wp-content/uploads/2015/03/VAN3.fw_.png);
}
body.custom-background.page-id-822 {
background-image: url(http://thedoughbros.ie/wp-content/uploads/2015/03/Restaurant3.fw_.png);
}
@media screen and (max-width: 940px) page.custom-background.page-id-806 {
background: #fff !important;
}
body.custom-background.page-id-346 {
background-image: url(http://thedoughbros.ie/wp-content/uploads/2015/06/14jun.fw_.png);
}
只需添加新的CSS块
@media screen and (max-width: 940px) page.custom-background.page-id-807 {
background: #fff !important;
}
@media screen and (max-width: 940px) page.custom-background.page-id-808 {
background: #fff !important;
}
@media screen and (max-width: 940px) page.custom-background.page-id-809 {
background: #fff !important;
}
或多个
@media screen and (max-width: 940px) page.custom-background.page-id-807, page.custom-background.page-id-808, page.custom-background.page-id-809, page.custom-background.page-id-810 {
background: #fff !important;
}