日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > CSS >内容正文

CSS

CSS响应式:根据分辨率加载不同CSS的几个方法

發(fā)布時(shí)間:2025/3/20 CSS 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CSS响应式:根据分辨率加载不同CSS的几个方法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

一般情況下,根據(jù)分辨率加載pc端 wap端 pad端三個(gè)css文件,示例:

<link rel="stylesheet" type="text/css" href="./css/style.css" media="all"> <link rel="stylesheet" href="./css/phone.css" media="(max-width:620px)"> <link rel="stylesheet" href="./css/pad.css" media="screen and (max-width:1024px) and (min-width:621px)">
//其中 media 是媒體查詢的范圍,當(dāng)最大寬度是1200,這里就是手機(jī)平板一下的尺寸 加載手機(jī)css ,反之電腦css
<link rel="stylesheet" type="text/css" href="../css/m_wuqinglan.css" media="screen and (max-width:1200px)"/> <link rel="stylesheet" type="text/css" href="../css/pc_wuqinglan.css" media="screen and (min-width:1201px)"/>

只有一個(gè)css文件情況下,根據(jù)分辨率調(diào)整css樣式,示例:

@media screen and (max-width:620px){.logo{width: 300px;margin-left: -140px;} }@media screen and (max-width:1024px) and (min-width:621px) {.logo{width: 220px;margin-left: -99px;}.nav li:nth-of-type(2),.nav li:nth-of-type(3){width: 8%;}.nav li:nth-of-type(5),.nav li:nth-of-type(6){width: 12%;} }

?

轉(zhuǎn)載于:https://www.cnblogs.com/yuan9580/p/11513013.html

總結(jié)

以上是生活随笔為你收集整理的CSS响应式:根据分辨率加载不同CSS的几个方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。