Search code examples
javascripthtmlcssdhtml

Check users resolution in css?


is it possible to behave according to the user's resolution?


Solution

  • Not with CSS, no. But with JS, sure.

    if (window.screen.width <= 800 && window.screen.height <= 600) {
        //do something();
    }