CSS3的Media Queries实例分析
发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,这篇"CSS3的Media Queries实例分析"文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起
千家信息网最后更新 2025年11月07日CSS3的Media Queries实例分析
这篇"CSS3的Media Queries实例分析"文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇"CSS3的Media Queries实例分析"文章吧。
一、Media Queries 支持的属性
属性 值 Min/Max 描述color integer yes 每种色彩的字节数color-index integer yes 色彩表中的色彩数device-aspect-ratio integer/integer yes 宽高比例device-height length yes 设备屏幕的输出高度device-width length yes 设备屏幕的输出宽度grid integer no 是否是基于格栅的设备height length yes 渲染界面的高度monochrome integer yes 单色帧缓冲器中每像素字节resolution resolution yes 分辨率scan no tv媒体类型的扫描方式width length yes 渲染界面的宽度orientation Portrait/landscape no 横屏或竖屏
height min-height max-heightdevice-width min-device-width max-device-widthdevice-height min-device-height max-device-heightaspect-ratio min-aspect-ratio max-aspect-ratiodevice-aspect-ratio min-device-aspect-ratio max-device-aspect-ratiocolor min-color max-colorcolor-index min-color-index max-color-indexMonochrome min-monochrome max-monochromeResolution min-resolution max-resolution
二、关键字
and - 结合多个媒体查询not - 排除某种制定的媒体类型only - 用来定某种特定的媒体类型
三、引用样式示例
<link rel="stylesheet" media="all" href="style.css" /><link rel="stylesheet" media="screen and (min-width:980px)" href="desktop.css" /><link rel="stylesheet" media="screen and (min-width:768px) and (max-width:980px)" href="pad.css" /><link rel="stylesheet" media="screen and (min-width:480) and (max-width: 768px)" href="phone.css" /><link rel="stylesheet" media="screen and (max-width:320px)" href="small.css" />
四、内联样式示例
@media screen and (min-width: 980px) { //css code}@screen and (min-width:768px) and (max-width:980px) { //css code}@screen and (min-width:480) and (max-width: 768px) { //css code}@screen and (max-width:320px) { //css code}@media screen and (max-device-width: 480px) { //max-device-width等于480px}@media screen and (device-aspect-ratio: 16/9), screen and (device-aspect-ratio: 16/10) { //设备宽高比}@media all and (orientation:portrait) { //竖屏}@media all and (orientation:landscape) { //横屏}以上就是关于"CSS3的Media Queries实例分析"这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注行业资讯频道。
内容
媒体
设备
实例
实例分析
分析
类型
色彩
字节
宽度
屏幕
属性
文章
样式
界面
知识
示例
篇文章
高度
输出
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
黑保利服务器
开物品的图片数据库
互联网科技素材海报
网络安全法规定 各级
纳米云服务器
ie服务器错误是为什么
海南天奇达互联网科技有限公司
怎么修改数据库的默认字符集
路北区软件开发答疑解惑
数据库学生考勤管理系统实验报告
宝鸡市软件开发单位
唐山国安网络技术有限公司
直播网络技术发展前景
无线传感器网络技术概述
国内网络安全攻击事件
吉林特色软件开发
郑州网络安全科技
南京计算机网络技术实习招聘
电脑怎么删除 清理数据库
vue 背景图放服务器上不显示
数据库原表更新视图更新吗
网络安全六个坚持原则
大学生网络安全判断题及答案
ie服务器错误是为什么
新苹果手机换机后无法连接服务器
t3服务器改ip之后
网络安全维护建议
服务器什么系统好
技校计算机网络技术求职方向
沈阳排队网络技术有限公司