Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用chrome但不使用safari、ie或firefox的媒体查询?_Html_Css_Media Queries - Fatal编程技术网

Html 使用chrome但不使用safari、ie或firefox的媒体查询?

Html 使用chrome但不使用safari、ie或firefox的媒体查询?,html,css,media-queries,Html,Css,Media Queries,这让我抓狂,我似乎找不到媒体查询的问题,但除了ios 7和chrome上的mobile safari,它在任何浏览器中都不起作用。我认为这是一个疯狂的语法错误,但我还是找不到任何东西。顺便说一句,媒体查询都在自己的文件(mediaquerys.css)中,并链接在所有样式表的底部 @media screen and(max-width: 1100px) { #bottombar ul li{ margin-right: 24px; } } @media scre

这让我抓狂,我似乎找不到媒体查询的问题,但除了ios 7和chrome上的mobile safari,它在任何浏览器中都不起作用。我认为这是一个疯狂的语法错误,但我还是找不到任何东西。顺便说一句,媒体查询都在自己的文件(mediaquerys.css)中,并链接在所有样式表的底部

@media screen and(max-width: 1100px) {

    #bottombar ul li{
        margin-right: 24px;
    }
}
@media screen and(max-width: 1030px) {
    #bottombar ul li{
        margin-right: 20px;
    }
}
@media screen and(max-width: 955px) {
    #bottombar ul li a{
        font-size: 15px;
    }
    #bottombar ul{
        margin-left: -25px;
    }
}
@media screen and(max-width: 925px) {
    #bottombar ul li a{
        font-size: 15px;
    }
}
@media screen and(max-width: 880px) {
    #bottombar input{
        display: none;
    }
    #alternativesearch input{
        display: block;
    }
}
@media screen and(max-width: 800px) {
    section#skills ul{
        float: none;
        /*margin: 0 auto;*/
        margin-left: -70px;
        width: 100%;
    }   
    section#skills ul h3{
        font-size: 30px;
    }
    section#skills ul li{
        font-size: 20px;
    }
    h1.catcher_title{
        margin-top: 50px;
    }
}
@media screen and(max-width: 770px) {
        #image_placeholder,#about article{
            float: none; width: 100%;
        }
        #about article{
            margin: 0;
        }
        #skills{
            margin-top: -300px;
        }
}
@media screen and(max-width: 735px) {
    h1.catcher_title{
        margin-top: 30px;
    }
    h3.catcher_title{
        margin-top: -30px;
    }
}   
@media screen and(max-width: 700px) {
    #bottombar ul li a{
        font-size: 13px;
    }
}   
@media screen and(max-width: 648px) {
    #bottombar ul li a{
        font-size: 13px;
    }
    .popup{
        width: 300px;
        margin-left: -150px;
    }
    h1.catcher_title{
        margin-top: 60px;
    }
}
/*@media screen and(min-width: 500px){
    #bottombar{
        border-top: 8px solid #16A07A;
        height: 52px;
    }
}*/ 
@media screen and(max-width: 540px){
    #bottombar ul li:last-child{
    display: block;
}
    #cart{top:20px;}
    #view_cart{top:40px;}
    #alternativesearch input:focus{
        width: 150px;
        top:25px;
    }
    #alternativesearch input{
        top:25px;
    }
    h3.catcher_title{
        margin-top: -20px;
    }
    body{margin-top: 0px;}
    #bottombar{
        height: 16px;
        top:0px;
        border: none;
        overflow: hidden;
        background: transparent;
    }
    #logo{display: none;}
    #menutoggle{
        display: block;
    }
    #bottombar ul{
        margin-left: -50px;
    }
    #bottombar ul li:nth-child(1){
        border-top: 1px solid green;
    }
    #bottombar ul li{
        width: 100%;
        /*height: 20px;*/
        margin-left: 0;
        /*background: #1C8C0F;*/
        border-bottom: 1px solid green; 
        margin-right: 0;
        text-align: center;
    }
    #bottombar ul li:hover{
        background: green;
    }
    #bottombar ul li a{
        display: block;
        font-size: 20px;
        line-height: 120%;
    }
}

也许您应该使用最小宽度而不是最大宽度。您的样式可能总是可见/不可见,因为总有一个最大宽度


虽然语法很好,但也要根据html结构检查层次结构是否良好。

也许你应该使用最小宽度而不是最大宽度。您的样式可能总是可见/不可见,因为总有一个最大宽度


虽然语法很好,但也要根据html结构检查层次结构是否良好。

我刚刚用验证了您的代码,并注意到“and”导致了问题,基本上您需要在“and”之后留出一个空格


我刚刚用验证了您的代码,并注意到“and”导致了问题,基本上您需要在“and”之后留出一个空格


您是否有任何HTML可供使用?您可能希望使用最小宽度值,首先从最小尺寸开始,然后使用较大尺寸。您是否有任何HTML可供使用?您可能希望使用最小宽度值,首先从最小尺寸开始,然后使用较大尺寸。
@media screen and (max-width: 1100px) {

        #bottombar ul li{
            margin-right: 24px;
        }
    }
    @media screen and (max-width: 1030px) {
        #bottombar ul li{
            margin-right: 20px;
        }
    }
    @media screen and (max-width: 955px) {
        #bottombar ul li a{
            font-size: 15px;
        }
        #bottombar ul{
            margin-left: -25px;
        }
    }
    @media screen and (max-width: 925px) {
        #bottombar ul li a{
            font-size: 15px;
        }
    }
    @media screen and (max-width: 880px) {
        #bottombar input{
            display: none;
        }
        #alternativesearch input{
            display: block;
        }
    }
    @media screen and (max-width: 800px) {
        section#skills ul{
            float: none;
            /*margin: 0 auto;*/
            margin-left: -70px;
            width: 100%;
        }   
        section#skills ul h3{
            font-size: 30px;
        }
        section#skills ul li{
            font-size: 20px;
        }
        h1.catcher_title{
            margin-top: 50px;
        }
    }
    @media screen and (max-width: 770px) {
            #image_placeholder,#about article{
                float: none; width: 100%;
            }
            #about article{
                margin: 0;
            }
            #skills{
                margin-top: -300px;
            }
    }
    @media screen and (max-width: 735px) {
        h1.catcher_title{
            margin-top: 30px;
        }
        h3.catcher_title{
            margin-top: -30px;
        }
    }   
    @media screen and (max-width: 700px) {
        #bottombar ul li a{
            font-size: 13px;
        }
    }   
    @media screen and (max-width: 648px) {
        #bottombar ul li a{
            font-size: 13px;
        }
        .popup{
            width: 300px;
            margin-left: -150px;
        }
        h1.catcher_title{
            margin-top: 60px;
        }
    }
    /*@media screen and (min-width: 500px){
        #bottombar{
            border-top: 8px solid #16A07A;
            height: 52px;
        }
    }*/ 
    @media screen and (max-width: 540px){
        #bottombar ul li:last-child{
        display: block;
    }
        #cart{top:20px;}
        #view_cart{top:40px;}
        #alternativesearch input:focus{
            width: 150px;
            top:25px;
        }
        #alternativesearch input{
            top:25px;
        }
        h3.catcher_title{
            margin-top: -20px;
        }
        body{margin-top: 0px;}
        #bottombar{
            height: 16px;
            top:0px;
            border: none;
            overflow: hidden;
            background: transparent;
        }
        #logo{display: none;}
        #menutoggle{
            display: block;
        }
        #bottombar ul{
            margin-left: -50px;
        }
        #bottombar ul li:nth-child(1){
            border-top: 1px solid green;
        }
        #bottombar ul li{
            width: 100%;
            /*height: 20px;*/
            margin-left: 0;
            /*background: #1C8C0F;*/
            border-bottom: 1px solid green; 
            margin-right: 0;
            text-align: center;
        }
        #bottombar ul li:hover{
            background: green;
        }
        #bottombar ul li a{
            display: block;
            font-size: 20px;
            line-height: 120%;
        }
    }