Search code examples
cssmedia-querieslandscape

CSS fail in landscape


I want to resize column width using media queries but i can't able to so i need expert advice and i can show you whole code if you want.The problem is occuring in my .cities class and .cities .col, i can't change width,font-size,icon size. Nothing at all.

Thank You

CSS code:

 @media only screen and (max-width:767) and (orientation:landscape) {
        /* Styles for Landscape screen */
        header {
            height: 200vh;
        }
        header nav li a {
            font-size: 85%;
        }
        .cities .col {
            display: block;
            width: 100%;
        }
        .cities h3 {
            font-size: 10%;
        }
        .ios-small {
            font-size: 100%;
        }
        .cities .col img {
            width: 100%
        }
        .cities {
            padding: 0px;
        }
        .cities .col {
            margin-top: 5%;
            padding-bottom: 2%;
            width: 100%;
            transition: width 0.3s;
        }
        .cities .col:hover {
            background: rgba(234, 234, 234, 0.9);
            color: black;
        }
        .cities .col img {
            width: 100%;
            height: auto;
            margin: 0 0 0 0px;
        }
        .cities h3 {
            text-align: left;
            margin: -4px 0 0 0px;
            font-size: 100%;
        }
        .ios-small {
            font-size: 20%;
            font-weight: 200;
            margin-right: 5px;
            font-style: italic;
            color: #e67e22;
        }
    }

This is the Preview of Website in Iphone6 Landscape


Solution

  • You need to add a unit for your breakpoint so max-width:767px.