← Back to at-rules

CSS At-rule

@viewport

Responsive

Controls viewport settings directly in CSS — a deprecated alternative to the HTML meta viewport tag.

Syntax

@viewport { width: device-width; }

Example

@viewport { width: device-width; initial-scale: 1; }

Common use cases

  • Viewport control in CSS (deprecated)
  • Legacy IE and Edge mobile support

Practical developer insight

@viewport is deprecated and removed from all modern browsers — always use <meta name='viewport'> in your HTML head instead.

Related