viewport

The viewport meta tag defines a set of properties that specify the behavior and initial appearance of the web page when it is displayed in the browser window.

The directive specified by this meta tag is a list of one or more properties, specified within a comma-separated list. All properties are optional; for any properties that are not defined, the BlackBerry Browser infers a value based on the default browser behavior. For example:

<meta name="viewport" content="width=320; initial-scale=1.0; user-scalable=no;">

The BlackBerry Browser supports the following viewport properties.

Directive properties

Description

Availability

width

Specifies the width of the viewport, in pixels. This property also accepts a value of device-width constant, which enables the browser to define the viewport width based on the available screen width.

4.6+

height

Specifies the height of the viewport, in pixels. This property also accepts a value of device-height constant, which enables the browser to define the viewport height based on the available screen height.

In practice, this property is typically unnecessary; the browser automatically defines the height based on the vertical space required to compose the layout of the content.

6.0+

initial-scale

Specifies the scale at which the browser initially renders the viewport. The value is defined as a multiplier. A value of 2.0 means that the viewport is doubled in size and rendered at a scale of 200%.

6.0+

maximum-scale

Specifies the maximum scale value for the viewport. The value is defined as a multiplier.

6.0+

minimum-scale

Specifies the minimum scale value for the viewport. The value is defined as a multiplier.

6.0+

user-scalable

Specifies whether the user can adjust the scale of the viewport. The value can be yes or no. A value of yes permits user scaling; a value of no prevents user scaling.

6.0+

target-densitydpi

Specifies the target pixel density for which the web page is designed. This property can have one of the following values:

  • device-dpi: Specifies that the device's native pixel density should be used as the target dpi. The browser renders the content without scaling it.
  • high-dpi: Specifies that the content is intended for high-density screens. The browser scales down the content for lower-density screens as necessary.
  • medium-dpi: Specifies that the content is intended for medium-density screens. The browser scales the content up for high density screens scale up. There are no BlackBerry devices that support the target-densitydpi directive that have low density screens.
  • low-dpi: Specifies that the content is intended for low-density screens. The browser scales the content up for higher density screens as necessary.
  • dpi-value : Specifies a dpi value between 70 and 400 to use as the target dpi.

7.0+

Last modified: 2014-03-10



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus