gpt4 book ai didi

header 中的 css3 媒体查询不起作用

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

我有两份样式表,一份用于移动设备,一份用于计算机。我想默认使用我的移动表格。

我的标题检查:

 <link rel='stylesheet' media='all' href='css/mobile.css' />
<link rel='stylesheet' media='screen and (min-width: 580px)' href='css/large.css' />

但当我检查移动浏览器时,我似乎仍在使用我的大型样式表! (iPhone 4)

最佳答案

尝试做这样的事情:(我的代码)

<link href="css/mobile_portrait.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 320px) and (orientation: portrait)">
<link href="css/mobile_landscape.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 480px) and (orientation: landscape)">
<link href="css/tablet.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 769px)">
<link href="css/netbook.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 1024px)">
<link href="css/desktop.css" rel="stylesheet" type="text/css" media="only screen and (min-width: 1224px)">

(只是例子)

关于 header 中的 css3 媒体查询不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25810973/

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