简体   繁体   English

如何基于条件媒体查询应用 CSS?

[英]How to apply CSS based on conditional media query?

I got a WordPress page with three CTA buttons on it that need to be applied following CSS to when on resolutions of less than 576px and between 750px to 900px.我有一个 WordPress 页面,上面有三个 CTA 按钮,当分辨率小于 576px 和 750px 到 900px 时,需要按照 CSS 应用这些按钮。 Please help me understand how to write a conditional media query to apply the following CSS.请帮助我了解如何编写条件媒体查询以应用以下 CSS。

padding-left: 1rem;
padding-right: 1rem;
font-size: 1.1rem;

Use this queries and paste your code inside of both.使用此查询并将您的代码粘贴到两者中。

@media only screen and (max-width: 576px)  {...}
@media only screen and (min-width: 750px) and (max-width: 900px)  {...}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM