前端技术

media screen-制作响应式设计

2018-11-26  本文已影响4人  前端来入坑

media

当你重置浏览器大小的过程中,页面也会根据浏览器的宽度和高度重新渲染页面。

1、使用方法一

@media screen and (max-width: 600px) {
    body {
        background-color:lightblue;
    }
}

2、使用方法二

<link href="/css/mobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 750px)">

<link href="/css/pad.css" rel="stylesheet" type="text/css" media="screen and (min-width: 750px) and (max-width:1200px)">

<link href="/css/pc.css" rel="stylesheet" type="text/css" media="screen and (min-width: 1200px)">

连接更多请看官网
http://www.w3school.com.cn/tags/att_link_media.asp
http://www.runoob.com/cssref/css3-pr-mediaquery.html

上一篇下一篇

猜你喜欢

热点阅读