Skip to content

Commit

Permalink
added a note about comma separation and example of interactive-widget…
Browse files Browse the repository at this point in the history
… syntax
  • Loading branch information
dletorey committed Nov 27, 2024
1 parent c1fd7dc commit e390a32
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions files/en-us/web/html/viewport_meta_tag/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ The basic attributes of the "viewport" `<meta>` element include:
- `interactive-widget`
- : Specifies the effect that interactive UI widgets, such as a virtual keyboard, have on the page's viewports. Valid values: `resizes-visual`, `resizes-content`, or `overlays-content`. Default: `resizes-visual`.

> [!NOTE]
> Multiple attributes can be added separated by commas.
```html
<meta
name="viewport"
content="width=device-width, initial-scale=1, interactive-widget=overlays-content" />
```

> [!WARNING]
> Usage of `user-scalable=no` can cause accessibility issues to users with visual impairments such as low vision. [WCAG](/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable#guideline_1.4_make_it_easier_for_users_to_see_and_hear_content_including_separating_foreground_from_background) requires a minimum of 2× scaling; however, the best practice is to enable a 5× zoom.
Expand Down Expand Up @@ -82,6 +91,10 @@ Allowed values are:
- `overlays-content`
- : Neither the {{Glossary("viewport")}} nor the {{Glossary("visual viewport")}} gets resized by the interactive widget.

```html
<meta name="viewport" content="interactive-widget=resizes-content" />
```

When the {{Glossary("viewport")}} gets resized, the initial [containing block](/en-US/docs/Web/CSS/Containing_block) also gets resized, thereby affecting the computed size of [viewport units](/en-US/docs/Web/CSS/length#relative_length_units_based_on_viewport).

## Common viewport sizes for mobile and tablet devices
Expand Down

0 comments on commit e390a32

Please sign in to comment.