当 @media screen and (max-width: 500px) 处于事件状态时移除类 .fade 。我怎样才能做到这一点?我的脚本在下面。
@media screen and (max-width: 500px) {
.post_profile_image{
width:35px;
height:35px
}
.fade{
/* Remove this class */
}
}
<div id="myModal" class="modal fade" role="dialog">
最佳答案
How to remove class with media queries
你不知道。相反,您定义适用于执行您想要完成的样式的类的新规则。媒体查询不能向元素添加或删除类,它们只是更改适用于元素的规则。
关于javascript - 如何使用媒体查询删除类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32421616/