fedor.belov
fedor.belov

Reputation: 23323

When do I need *-device-width?

I'm creating responsive web app for desktop and mobile devices. My problem is I don't know when I need to use *-device-width. Pls explain usecases for *-device-width. Why should I use it instead of *-width?

Upvotes: 0

Views: 110

Answers (2)

imakeitpretty
imakeitpretty

Reputation: 2116

From Difference between width and device-width in CSS media queries:

device-width is the...

width of the output device (meaning the entire screen or page, rather than just the rendering area, such as the document window).

Source.

The width...

describes the width of the rendering surface of the output device (such as the width of the document window, or the width of the page box on a printer)

Source.

Upvotes: 0

DOCbrand
DOCbrand

Reputation: 339

You use it with a meta tag, which you will add to your head tag

<meta name="viewport" content="width=device-width" />

Upvotes: 1

Related Questions