html - 我们如何使@media only max-width 不适用于更大的屏幕?
问题描述
我如何使它如此'保证金:0自动;' 仅适用于移动设备?无论出于何种原因,它也将其应用于台式机和 ipad。
@media only screen and (max-width: 1024px) {
#scrollToTopBtn{
display: none !important;
}
}
@media only screen and (max-width: 768px) {
.card-buttons{
margin: 0 auto;
}
}
边距 - 自动;将 div 中的按钮居中应用于 ipad/桌面尺寸。
解决方案
您可以在查询中使用min-width
和来更多地指定您的设备屏幕。max-width
@media()
@media only screen and (min-width: 200px) and (max-width: 767px) {
//Put your CSS here for 200px to 767px width devices (cover all mobile portrait width //
}
推荐阅读
- excel - Extract the initials of first name and last name as well as number to form an ID number
- c# - How to solve Asp.Net 3.0 Migrating DB issue from SQLite to MySQL?
- google-apps-script - Using Google app script, hangout image aspect ratio not working
- excel-formula - 2列,A和B,A列是T/F,B列是非负浮点数,我想知道A = T和B = 0的第一个单元格(或行)
- nested - 聚合子实体的不变性
- angular - 使用角度将多 json 映射到对象
- c# - 如何强制 Visual Studio 使用特定的框架版本
- swiftui - 文本会被 SwiftUI 剪切,但是为什么呢?
- php - 计算图像中任意颜色质心并将其提供给 PHP 的最快方法
- python - 如何迭代 Django 模型字段,并根据条件添加值