我有一个avada wprdpress主题的网站。我在主题选项的“自定义CSS”中添加了自定义css。这适用于台式机,但不适用于移动解决方案。
示例:
/* Portrait and Landscape */
@media only screen and (min-device-width: 320px) and (max-device-width: 640px){
.fusion-alignleft{
max-width: 80%;
float:left;
}
.fusion-alignright{
max-width: 20%;
float:right;
}
.fusion-contact-info {
padding: 1em 0px;
line-height: 1.5em;
}
.fusion-body .fusion-mobile-menu-design-modern .fusion-secondary-header .fusion-alignright{
text-align: right;
}
}
如何在avada wordpress主题选项中添加自适应样式?
答案 0 :(得分:1)
在CSS媒体中,设备宽度和宽度分辨率之间存在差异。您可以在此处详细了解:http://www.javascriptkit.com/dhtmltutors/cssmediaqueries2.shtml
那说,试试这个......
@media all and (min-width: 320px) and (max-width: 640px) {
.fusion-alignleft {
max-width: 80%;
float:left;
}
.fusion-alignright {
max-width: 20%;
float:right;
}
.fusion-contact-info {
padding: 1em 0px;
line-height: 1.5em;
}
.fusion-body .fusion-mobile-menu-design-modern .fusion-secondary-header .fusion-alignright {
text-align: right;
}
}