You can use device-width which will test of the screen's width in px. That however is not entirely recommended. Use max-width and min-width (for the viewport) ...
CSS media queries are a powerful tool for achieving this. It allows you to apply different styles based on specific conditions such as screen size, resolution, ...
Media queries can be used to check many things, such as: width and height of the viewport; width and height of the device; orientation (is the tablet/phone in ... CSS min-block-size property · CSS @namespace Rule · The @media Rule