gpt4 book ai didi

css - 媒体查询留空 - 这会导致问题吗?

转载 作者:太空宇宙 更新时间:2023-11-04 03:44:27 25 4
gpt4 key购买 nike

我对在我的样式表中将@media 定义留空感到好奇,这是否会导致页面呈现出现问题?

我只想包含那些用于演示的查询 - 向它们展示可以对启用的查询进行响应。

这是我的CSS:

/*************************************************************************************************/
/* Media Queries - Responsive Layout Definitionen */
/*************************************************************************************************/

/* Smartphones (Portrait und Landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}

/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
/* Styles */
}

/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
/* Styles */
}

/* iPads (Portrait und Landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
}

/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */
}

/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Styles */
}

/* Desktops und Laptops ----------- */
@media only screen
and (min-width : 1224px) {
/* Styles */
}

/* Große Screens ----------- */
@media only screen
and (min-width : 1824px) {
/* Styles */
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}
/*************************************************************************************************/
/* ==================== */
/*************************************************************************************************/

最佳答案

@media 规则对页面呈现或样式表解析没有影响。只需确保正确打开和关闭它们即可。

如果您需要详细信息,可以在 spec 中找到语法的相关部分。 .但简而言之,@media 规则可能嵌套有零个或多个规则,这意味着它可能是空的,没有问题。

关于css - 媒体查询留空 - 这会导致问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24361700/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com