We use cookies to enhance your experience on the site
CodeWorlds

Viewport

A responsive page is one that looks good on all devices and automatically adapts to different screen sizes.

In the past, a special version of the page was created for mobile devices - m.domain.com. Nowadays, everything is done using HTML and CSS.

To create a responsive page, we need to pass information that the page should be responsive to our HTML file.

The first step is to add inside the head tag:

1<meta name="viewport" content="width=device-width, initial-scale=1.0">

Before: alt text

After: alt text

Go to CodeWorlds