1

I am working on this wordpress style sheet.

Below code, When I resize the screen using the mouse it kicks in and show the responsiveness. But when I use the Chrome Dev tools and clicking each different device sizes it does not kick in. Also I have checked this via my mobile phone and its not showing the responsive design.

What I'm doing wrong here?

.specials{
    display: flex;
    //padding: 30px;
    text-align: center;

    @media screen and (max-width: 600px){
        flex-direction: column;
    }
    .content{
        width: 50%;
        padding: 30px;
        background-color: rgba($color: $primary, $alpha: 0.5);
        display: flex;
        flex-direction: column;
        justify-content: center;
        p{
            line-height: 30px;
        }

        @media screen and (max-width: 600px){
            width: 100%;
        }
    }

    .image{
        width: 50%;
        //padding: 30px;
        background-color: #000;
        img{
            max-width: 100%;
            height: auto;
        }

        @media screen and (max-width: 600px){
            width: 100%;
        }
    }
}
3
  • 1
    Are you sure your device resolution is <= 600px? Else only the styles outside the media queries will be applied. Same with the Chrome Dev Tools - did you make sure the devices you selected have width <= 600px? Commented Aug 7, 2023 at 13:20
  • 1
    Actually, @RenevanderLende, nesting is coming to CSS and most browsers already support it. That aside, make sure you include the viewport meta tag on your page; something like <meta name="viewport" content="width=device-width,initial-scale=1.0">. That should help.
    – user3546284
    Commented Aug 7, 2023 at 14:01
  • Cool, I've added an answer so this question can be properly closed. Glad I could help!
    – user3546284
    Commented Aug 7, 2023 at 14:10

1 Answer 1

2

If your page is rendering things too small in the browser's responsive mode, then you probably forgot the viewport meta tag:

<meta name="viewport" content="width=device-width,initial-scale=1.0">

Adding that will render your site at the proper size for mobile devices (including those emulated by the reponsive mode in desktop browsers).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.