网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

CSS3的MediaQueries实例分析

这篇“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实例分析”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注创新互联行业资讯频道。


分享文章:CSS3的MediaQueries实例分析
URL分享:http://bjjierui.cn/article/jodoho.html

其他资讯