zoukankan      html  css  js  c++  java
  • CSS响应式网站开发

    <html>

    <head>

    //当设备屏幕最大宽度小于1024px时加载如下CSS内容

    @media screen and (max- 1024px){
                body{
                    1024px;
                }
                #main{
                 background-image:url(img/bg1.jpg);
                }
            }

    //all代表所有类型的设备

    @media all and (max- 1024px){
                body{
                    1024px;
                }
                #main{
                 background-image:url(img/bg1.jpg);
                }
            }

    //简写

    @media and (max- 1024px){
                body{
                    1024px;
                }
                #main{
                 background-image:url(img/bg1.jpg);
                }
            }

    //可以使用and, or, not进行运算

    //判断方向是否为纵向

    @media and (max- 1024px) and (orientation:portrait){
                body{
                    1024px;
                }
                #main{
                 background-image:url(img/bg1.jpg);
                }
            }

    </head>

    <body>

    <div id=”main”>

    </div>

    </body>

    </html>

    记录下来,留待后查,也方便别人。

    联系我:renhanlinbsl@163.com

    2016.7.25

    11:38

  • 相关阅读:
    对于excel的操作
    初试 ElasticSearch
    02-基本数据类型
    javascript 三种数组扁平化方式
    javascript数组操作方法
    javascript数组的16种循环(包含ES5、ES6)
    01-typescript-安装及编译
    nvm管理多版本node
    css块级居中的四种方法
    javascript try-catch-finally异常捕获
  • 原文地址:https://www.cnblogs.com/ives/p/cssMedia.html
Copyright © 2011-2022 走看看