【发布时间】:2018-03-07 23:07:01
【问题描述】:
我正在尝试使用 WORDPRESS 使网站具有响应性,因此在使用不同设备和使用不同浏览器检查网站时,每个地方都使用相同的 css。
所以我决定使用以下格式将我的网站分为 3 个不同的部分,分别用于普通电脑、平板电脑和智能手机:
@media (min-width:767px){}
@media (max-width:766px) and (min-width:400px) {}
@media only screen and (max-width: 399px) {}
那么对于我正在做的不同浏览器:
/*edge*/
@supports (-ms-ime-align:auto) and (max-width:400px) {}
/*chrome*/
@media (-webkit-min-device-pixel-ratio:0) and (max-width: 766px) and (min-width: 400px) {}
问题是我不能为opera和firefox做同样的事情,我的意思是我为firefox做的:
/*firefox
@supports (-moz-appearance:none) and (max-width: 399px){
#pg-4-0{
height: 1400px!important;
}
#newROW{
margin-top: 20px;
}
}
*/
/*
@supports (-moz-appearance:none) and (max-width: 399px) {
#pg-4-0{
height: 1150px!important;
}
#newROW{
margin-top: 20px;
}
}
*/
但它无法正常工作,我不得不将其删除。这是实现响应的正确方法吗?
有没有更好的方法来做到这一点?
我怎样才能为 Firefox 和 Opera 做到这一点? (我用wordpress做的网站:https://www.haagsehof.nl/)
【问题讨论】:
标签: css wordpress responsive-design