@media min-height不起作用

时间:2013-09-29 14:23:32

标签: css css3 media-queries

我尝试使用@media检查浏览器的高度,如果它小于600px

我想设置一个新的最大宽度和高度,那么我做错了什么?

或任何遗漏的语法?请指教和帮助,谢谢!

我还有其他的@media,但是身高却没有。

   @media only screen and (min-height: 600px){
        #book-container{
            max-width: 748px;
            max-height: 469px;
        }
    }

@media only screen and (max-width: 500px){
    #txt-search{
        visibility: hidden;
    }
}

#book-container{
    position: absolute;
    left: 0;
    right: 0;
    top: 0px;
    bottom: 0;
    margin-left: auto;
    margin-right: auto;
    margin-top: auto;
    margin-bottom: auto;
    width: 80%;
    max-width: 830px;
    max-height: 520px;

    /*max-width: 748px;*/
    /*max-height: 469px;*/
}

1 个答案:

答案 0 :(得分:0)

@media only screen and (min-height: 600px)适用于超过 600像素的屏幕宽度。通常,您需要max-*

@media only screen and (max-height: 600px) {
    …
}
相关问题