[ad_1]

Thanks to the smartphone, blog posts, research and exciting reservations can now be held from anywhere. The problem becomes annoying, however, when the website is displayed in a format that is much too small and the words only become recognizable by zooming in. Guilt is what is missing Metal element in favor of the viewport. Which it with that Viewport And why it is essential in favor of the rendering of web pages beyond mobile devices, you routinely in this fee.

E-book download: With an optimized website for more traffic and leads

Which are viewports?

That viewport denotes the Ad area of a website. This environment varies depending on the device from which the page is accessed. More precisely, that viewport also refers to a meta element in the Source code

If you don't set the viewport of your website, you will curse your visitors for many frustrating minutes of zooming in and scrolling back and forth. As more and more users search via mobile instead of using a stationary PC, such problems are becoming increasingly relevant. Anyone who misses the interface when it comes to mobile web design and none satisfactory user experience can open, the visitors will inevitably give up the pretense.

If your website uses the CMS Hub you shouldn't worry about the viewport. Your pages will involuntarily bend to the correct viewport on any device. Even you should - even in the context of one responsive design - Always set the viewport to give your mobile visitors a pleasant user experience.

This is what your page looks like with and without a viewport

If you don't put your viewport in favor of mobile devicesYour website will be displayed on these devices with the strength that is provided for the benefit of a typical desktop cigarette box. The mobile device then involuntarily shrinks the view so that it fits out of the small cigarette box, with the result that the texts and graphics are displayed minuscule. This is the so-called "standard width" with a pixel size between 800 - 1024.

If you put your viewport in favor of mobile devices, on the other hand, your website will involuntarily scale beyond the size of the screen on these devices and offer a far better user experience.

What exactly does that look like? In the example below, you can see a flicker box on the left side, in connection with which the viewport was not discontinued in favor of mobile devices. That one Mobile browser then involuntarily represents the strength intended for the benefit of unified desktop computers In the example on the right-hand side, the viewport was set so that the mobile browser involuntarily adjusts the strength and scales the content so that it is easy to read.

viewport optimization mobile website

Because first you should find out whether a viewport is already set. Simply result in the Google Mobile Ready Check by. Paste your URL in the space provided and click “Submit” on it. The tool tests whether your website is already optimized for the benefit of mobile devices and checks whether your viewport is set.

If your viewport has not yet been set, continue holding the lecture.

Viewport with determine

To set a mobile viewport, you should simply add a meta-viewport tag to all web pages that you want to optimize for mobile devices.

Simply copy the following Hypertext Markup Language tag and paste it into the header of your website:

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

If you include this viewport tag in your header file, it will automatically optimize your entire website for the benefit of mobile devices. However, it is also possible that you should insert the viewport tag in favor of each and every one of your websites. Especially when you are in favor of your website and yours Landing page use different software each time.

If you don't have an integrated CMS, such as the one CMS from HubSpot you should manually check piece by piece whether your landing pages, your websites and your internet diary already have a single viewport tag and are therefore optimized for the benefit of mobile devices.

A brief note on the Hypertext Markup Language tag

The bragging content = "idth = device-width" indicates that the Adjusts the pixel width to the strength of the respective deviceused to call up the website. Although it may then be that the font size and other content is shown enlarged in that horizontal viewing. To prevent that, give away the number "initial-scale" with 1. This number specifies the zoom factor. For that dressing up 1, the content is displayed in a ratio of 1: 1. So you get roughly the same proportions in that vertical and horizontal view of the mobile device. 

Smoke sign: Your website will not get any through the viewport tag responsive design - that's a different process. Certainly during the day, users should no longer have to laboriously zoom and scroll around in order to be able to lecture the content on your side.

Commit individual pixel width

If for some reason you want to display certain content in favor of a certain device in a certain thickness, then you should replace the number "device-width" with the pixel width of the desired device. When you unite Pixel value If you type in the tag, your website will be displayed on every device in this strength determined by you. 

Let's assume you would like to set a very specific strength. They differ from the model Width measurements of various iPhone models from each other. Then let's say you want your website to be displayed in the exact same size as the iPhone X's landscape format. The landscape format of the iPhone X is 812 pixels; after that you would the following day add to your website:

<meta name=viewport content=“width=812, initial-scale = 1 ″>

All iPads (as long as the iPad Pro) have a landscape format of 1024 pixels, after which you would add this tag to your website:

<meta name=viewport content=“width=1024, initial-scale = 1 ″>

Here is a full list of the different device sizes for the Viewport Tag.

Do not forget that if your viewport tag is set a certain size, visitors to your website could still face problems various mobile devices use.

A troubleshooting for this purpose could possibly JavaScripts with which you can select the individual meta tag attributes at least in proportion. However, you can save yourself such torture as you get the number "device-width" (device strength) in the viewport tag - that is definitely the simplest troubleshooting.

Viewport in CSS: Zoom control beyond mobile devices

There is another way to set the viewport. To do this, add the one corresponding element in CSS Your website. The procedure differs only slightly from inserting it into the Hypertext Markup Language Doc. 

To set the zoom factor in the CSS, copy the following code:

  @viewport {

width: device-width;

zoom: 1;

}

Add the rule to the Will Of your CSS, before all media queries. 

Regardless of whether you define the viewport in Hypertext Markup Language or in CSS, it is an absolute must in the context of any responsive design. 

Conclusion: Viewport is part of the standard of respinsive web design

That viewport must be set in the context of web pages in Hypertext Markup Language or CSS. If this is not the core, all of the content of a website will be forced into the glitz box on every device. The script, images and buttons are barely recognizable and the result is a bad user experience.

However, you can easily bypass that while you scroll through the display area through the appropriate one Hypertext Markup Language element or by a CSS rule define. Visitors who grab your site via mobile can visit your content undisturbed.

website optimizationCover photo: Chaosamran_Studio / iStock / Getty Images Plus

Originally published February 26, 2021, updated February 26, 2021

[ad_2]
Original source Hubspot

Published On: February 26th, 2021 / Categories: Digitales Marketing /

Leave A Comment

The latest newsletters

Sign up to stay informed.

    By submitting the form, you agree to our privacy policy.