Help Center

Local Navigation

HTML element: <meta>

Availability

BlackBerry® Device Software 3.7 or later

The <meta> element provides additional information about the document. If the <meta> element is included, the content attribute is required.

Considerations

The BlackBerry® Browser supports the HandheldFriendly and viewport meta values to help you to control the presentation of your content on the BlackBerry device screen.

On BlackBerry devices with BlackBerry Device Software version 4.6 or later, by default, the BlackBerry Browser renders desktop-oriented content as it would be displayed on a desktop-computer, then scales the content to fit the BlackBerry device screen. For most desktop-oriented content, the BlackBerry Browser renders it at 20% to 40% of its original size.

Content that is designed for the BlackBerry Browser should be presented to the user unscaled. You must inform the BlackBerry Browser that content is designed for the BlackBerry device screen by adding a <meta> tag to control the initial scale of your web page. Otherwise, the BlackBerry Browser will scale your content in error.

The BlackBerry Browser supports the following methods to control the initial display scale with the <meta> tag:

  • HandheldFriendly: The HandheldFriendly processing instruction informs the BlackBerry Browser that the content contained within the document is designed for small screens.
  • viewport: The viewport definition allows you to specify the specific dimensions of the intended viewport.

Although there are differences in the implementation of each method, you can achieve the same result using either method.

Attributes

Attribute

Value(s)

Description

Availability

content

text

Required. This attribute sets the meta information for the name or http-equiv attributes. The value of the content attribute depends on the value of the http-equiv or name attributes.

  • If http-equiv=“refresh”, this attribute specifies the URL to which the browser is redirected.
  • If http-equiv=“expires”, this attribute specifies the number of seconds after which the page is cleared from the cache. A value of -1 indicates that the page is not cached, so that the browser requests and downloads the page every time it is accessed.
  • If http-equiv=“cache-control”, this attribute specifies how the page is cached. The following values are acceptable:
    • Public: Page can be stored in public shared caches.
    • Private: Page can be stored only in private caches.
    • No-cache: Page can not be cached.
    • No-store: Page can be cached but not archived.
  • If name=”HandheldFriendly”, this attribute specifies whether or not the content is designed for small-screen handheld devices. Acceptable values are True or False.
  • If name=”viewport”, this attribute specifies the dimensions of the viewport. The value may be one or more comma-separated name-value pairs. The BlackBerry Browser supports the width, user-scalable, and initial-scale viewport properties.

3.7 or later

http-equiv

cache-control

expires

refresh

others

This attribute connects the content attribute to an HTTP header.

3.7 or later

name

HandheldFriendly

viewport

others

This attribute connects the content attribute to a name.

The BlackBerry Browser supports the HandheldFriendly and viewport values to control whether the browser is permitted to zoom in and out of content.

  • If name=”HandheldFriendly” and content=”true”, the content is assumed to be designed for small-screen devices.
  • If name=”viewport”, the browser sets the initial page size to the dimensions width properties using the content attribute.

4.6 or later

scheme

text

This attribute defines a format that is used to interpret the value of the content attribute.

4.6 or later

Common attributes

The <del> element supports the dir and lang attributes.

For more information, see Common attributes.

Code sample: Using the <meta> element to prevent unwanted content scaling

<html>
<head>
	<title>Test Page</title>
	<meta name=”HandheldFriendly” content=”true” />
</head>

Index


Was this information helpful? Send us your comments.