Media Query在SAP Spartacus里的用途
Media queries are useful when you want to modify your site or app depending on a device’s general type (such as print vs. screen) or specific characteristics and parameters (such as screen resolution or browser viewport width).
當我們需要根據設備類型或者某些特殊的特性或參數(比如屏幕分辨率或者瀏覽器viewport寬度)來調整app的行為時,Media query的技術顯得特別有用。
很多media特性都有一個特定的范圍,因此可以用min-或者max-等前綴,來標注其最小或最大值。
Many media features are range features, which means they can be prefixed with “min-” or “max-” to express “minimum condition” or “maximum condition” constraints.
例如,下列CSS僅當瀏覽器的viewport寬度小于等于12450px時才生效:
For example, this CSS will apply styles only if your browser’s viewport width is equal to or narrower than 12450px:
@media (max-width: 12450px) { ... }在SAP Spartacus里的使用場景如下:
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的Media Query在SAP Spartacus里的用途的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 景区回应“上厕所要花55元买门票”:园外
- 下一篇: Github提交记录里用户超链接无法显示