Maximising viewing area

What is the line of code to ensure that when viewing a website page, that it is always maximised to the area it is viewed on please?

Do you mean the viewport metatag?

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

A web page will, by default, extend to the full width of the viewport, unless you tell it to do otherwise by setting a width or a max-width.

Thanks for the quick responses - it is to maximise every page on a website, so that whatever device they are viewing it on, mobile phone, desktop, laptop, etc, etc, it will auto maximise to that particular screen.

Then you should be good to go.
Include the viewport tag in the head; and don’t set widths for containers, as blocks default to width: auto which fill the parent.

1 Like

Remember though that some sites don’t look good at full width (e.g. on a 27" imac or a 50" tv screen) so you still need to control the way that content is displayed at various widths even if just to set a max-width.

There is no one size fits all approach.:slight_smile:


I think there may be some confusion regarding “area”, “viewport” and “screen”

Page design can have some control over how the page is displayed in the viewport. It can not control the dimensions of a viewport within a screen.

If your intent is to ensure visitors have their viewport maximized, please abandon the idea. That is something that is under the visitors control and not a website.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.