plantuml最大宽度_CSS-最大宽度与最小宽度

2部分答案

第1部分:要回答“为什么人们使用最小宽度而不是最大宽度?”:

它与设计流程有关。 通常,使用最小宽度模式时,您将设计移动优先。 使用最大宽度模式,您将首先设计桌面。

以最小宽度移动优先,默认样式是移动样式。 之后的查询将针对越来越大的屏幕。

body {

/* default styles here,

targets mobile first */

}

@media screen and (min-width:480px) {

/* style changes when the screen gets larger */

}

@media screen and (min-width:800px) {

/* And even larger */

}

相反,使用最大宽度是桌面优先,然后添加查询以使样式适合移动设备

body {

/* default styles here,

targets desktops first */

}

@media screen and (max-width:800px) {

/* style changes when the screen gets smaller */

}

@media screen and (max-width:480px) {

/* And even smaller */

}

第2部分:对于宽度小于或等于360px的任何设备的特定自定义导航,请执行以下操作:

您可以将其作为单独的最大宽度查询包括在内,前提是这是该规则的唯一例外。 或使用该样式作为基准,然后将其更改为更大的屏幕。

如果您执行了例外处理(实际上并没有遵循移动优先设计方法),则可能是这样的:

body {

/* default styles here,

targets mobile first

ALSO will cover 361 - 479 width */

}

@media screen and (max-width:360px) {

/* style ONLY for screens with 360px or less width */

}

@media screen and (min-width:480px) {

/* style changes when the screen gets larger */

}

etc...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值