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).
當(dāng)我們需要根據(jù)設(shè)備類型或者某些特殊的特性或參數(shù)(比如屏幕分辨率或者瀏覽器viewport寬度)來(lái)調(diào)整app的行為時(shí),Media query的技術(shù)顯得特別有用。
很多media特性都有一個(gè)特定的范圍,因此可以用min-或者max-等前綴,來(lái)標(biāo)注其最小或最大值。
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僅當(dāng)瀏覽器的viewport寬度小于等于12450px時(shí)才生效:
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里的使用場(chǎng)景如下:
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結(jié)
以上是生活随笔為你收集整理的Media Query在SAP Spartacus里的用途的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 景区回应“上厕所要花55元买门票”:园外
- 下一篇: 网信办:百度、微博、豆瓣等履行主体责任不