zoukankan      html  css  js  c++  java
  • CSS响应式布局实例

    <style type="text/css">
            body{
                margin:0 auto;
                min-1366px;
            }
            a{
                text-decoration:none;
                color:black;
            }
            a:hover{
                color:orange;
            }
            a:visited{
                color:black;
            }
            #main{
                 background-image:url(img/bg.jpg);
                 background-position:contain;
                 background-size:100%100%;
                 height:826px;
            }

            @media (device-height:568px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone5 */
                #main{
                     background-image:url(img/bg1.jpg);
                     height:1080px;
                }
                #iptDown{
                    position:relative;
                    left:180px;
                    top:950px;
                    50%;
                }
            }
    @media only screen and (max-device-width :480px){
        #main{
                 background-image:url(img/bg1.jpg);
                 height:1880px;
            }
            #iptDown{
                    position:relative;
                    left:180px;
                    top:950px;
                    50%;
                }
        }

    /*6*/
    @media (min-device-width : 375px) and (max-device-width : 667px) and (-webkit-min-device-pixel-ratio : 2){
        #main{
                background-image:url(img/bg1.jpg);
                 height:1880px;
            }
            #iptDown{
                    position:relative;
                    left:180px;
                    top:950px;
                    50%;
                }
        }

    /*6+*/
    @media (min-device-width : 414px) and (max-device-width : 736px) and (-webkit-min-device-pixel-ratio : 3){
        #main{
                 background-image:url(img/bg1.jpg);
                 height:1880px;
            }
            #iptDown{
                    position:relative;
                    left:180px;
                    top:950px;
                    50%;
                }
        }

    /*魅族*/
    @media only screen and (min-device-width :1080px) and (-webkit-min-device-pixel-ratio : 2.5){
        #main{
                 background-image:url(img/bg1.jpg);
                 height:1880px;
            }
            #iptDown{
                    position:relative;
                    left:180px;
                    top:950px;
                    50%;
                }
        }

    /*mate7*/
    @media only screen and (min-device-width :1080px) and (-webkit-min-device-pixel-ratio : 3){
        #main{
                 background-image:url(img/bg1.jpg);
                 height:1880px;
            }
            #iptDown{
                    position:relative;
                    left:180px;
                    top:950px;
                    50%;
                }
        }

    /*4 4s*/
    @media only screen and (device-height :480px) and (-webkit-device-pixel-ratio:2){
        #main{
                 background-image:url(img/bg1.jpg);
                 height:1880px;
            }
            #iptDown{
                    position:relative;
                    left:180px;
                    top:950px;
                    50%;
                }
        }
            #topnav{
                float:right;
                margin-right:146px;
                margin-top:10px;
            }
            li{
                display:inline;
                border-right:1px solid #736e6e;
                margin-left:8px;
                font-size:22px;
            }
        </style>

    联系我:renhanlinbsl@163.com

    2016-7-25

    14:05

  • 相关阅读:
    jquery 内容选择器
    jquery 子选择器
    jquery 基础选择器
    jquery 基础过滤器
    jdk1.8+SpringAOP注解报java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut select错误的不知原因的解决办法[仅供参考]
    [Spring]@Autowired,@Required,@Qualifier注解
    [Spring]IOC控制反转和DI依赖注入
    [LeetCode]无重复字符的最长子串
    Spring-代理模式
    Spring-使用注解开发
  • 原文地址:https://www.cnblogs.com/ives/p/5703274.html
Copyright © 2011-2022 走看看