STYLE XHTML Element

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

The STYLE element defines a set of CSS style rules for the page. This element is not rendered and requires a closing tag.

Using this Element

There are some common properties and collections that apply to all the elements of the document object model, see Common Properties, Methods and Collections for the HTML Elements in Internet Explorer Mobile.

This element can be used within a web page with attributes.

This element can be used within scripts where it will have properties, events, methods and collections.

Attributes

The following table shows items that Internet Explorer Mobile supports.

Attribute Value Description

MEDIA

 

Specifies the type of media for which the CSS style rules were intended. If a value is not specified or the screen, handheld, or all value is specified, the style is used. Otherwise, the style is ignored.

 

all

Default. Intended for all devices.

 

handheld

Output is intended for handheld devices.

 

screen

Output is intended for computer screens.

TYPE

 

Retrieves the CSS language in which the style sheet is written. Internet Explorer Mobile assumes that the type is text/css and ignores the type

 

text/css

Internet Explorer Mobile assumes that the type is text/css and ignores the type.

Scripting Properties

The following table shows items that Internet Explorer Mobile supports.

Property Type Access Comments

backgroundAttachment

String

Read/write

Sets or retrieves how the background image is attached to the object within the document.

This has no effect on display. The property is parsed, but it is not used.

backgroundImage

String

Read/write

Sets or retrieves the background image of the object.

backgroundColor

String

Read/write

Sets or retrieves the color behind the content of the object.

backgroundPosition

String

Read/write

Sets or retrieves the position of the background of the object.

backgroundRepeat

String

Read/write

Sets or retrieves how the backgroundImage property of the object is tiled.

borderBottomColor

String

Read/write

Sets or retrieves the color of the bottom border of the object.

borderBottomStyle

String

Read/write

Sets or retrieves the style of the bottom border of the object.

borderBottomWidth

String

Read/write

Sets or retrieves the width of the bottom border of the object.

borderLeftColor

String

Read/write

Sets or retrieves the color of the left border of the object.

borderLeftStyle

String

Read/write

Sets or retrieves the style of the left border of the object.

borderLeftWidth

String

Read/write

Sets or retrieves the width of the left border of the object.

borderRightColor

String

Read/write

Sets or retrieves the color of the right border of the object.

borderRightStyle

String

Read/write

Sets or retrieves the style of the right border of the object.

borderRightWidth

String

Read/write

Sets or retrieves the width of the right border of the object.

borderTopColor

String

Read/write

Sets or retrieves the color of the top border of the object.

borderTopStyle

String

Read/write

Sets or retrieves the style of the top border of the object.

borderTopWidth

String

Read/write

Sets or retrieves the width of the top border of the object.

clear

String

Read/write

Sets or retrieves whether the object allows floating objects on its left side, right side, or both, so that the next text displays past the floating objects.

color

String

Read/write

Sets or retrieves the color of the text of the object.

cssText

String

Read/write

 

display

String

Read/write

Sets or retrieves whether the object is rendered.

fontFamily

String

Read/write

Sets or retrieves the name of the font used for text in the object.

fontSize

String

Read/write

Sets or retrieves a value that indicates the font size used for text in the object.

fontStyle

String

Read/write

Sets or retrieves the font style of the object as italic, normal, or oblique.

fontVariant

String

Read/write

Sets or retrieves whether the text of the object is in small capital letters.

fontWeight

String

Read/write

Sets or retrieves the weight of the font of the object.

height

String

Read/write

Sets or retrieves the height of the object.

listStyleImage

String

Read/write

This has no effect on display. The property is parsed, but it is not used.

listStylePosition

String

Read/write

Sets or retrieves a variable that indicates how the list-item marker is drawn relative to the content of the object.

listStyleType

String

Read/write

Sets or retrieves the predefined type of the line-item marker for the object.

marginBottom

String

Read/write

Sets or retrieves the height of the bottom margin of the object.

marginLeft

String

Read/write

Sets or retrieves the width of the left margin of the object.

marginRight

String

Read/write

Sets or retrieves the width of the right margin of the object.

marginTop

String

Read/write

Sets or retrieves the height of the top margin of the object.

overflow

String

Read/write

 

paddingBottom

String

Read/write

Sets or retrieves the amount of space to insert between the bottom border of the object and the content.

paddingLeft

String

Read/write

Sets or retrieves the amount of space to insert between the left border of the object and the content.

paddingRight

String

Read/write

Sets or retrieves the amount of space to insert between the right border of the object and the content.

paddingTop

String

Read/write

Sets or retrieves the amount of space to insert between the top border of the object and the content.

styleFloat

String

Read/write

Sets or retrieves on which side of the object the text will flow.

textAlign

String

Read/write

Sets or retrieves whether the text in the object is left-aligned, right-aligned, centered, or justified.

textDecoration

String

Read/write

Sets or retrieves a value that indicates whether the text in the object has blink, line-through, overline, or underline decorations.

textIndent

String

Read/write

Sets or retrieves the indentation of the first line of text in the object.

textOverflow

String

Read/write

 

textTransform

String

Read/write

Sets or retrieves the rendering of the text in the object.

This has no effect on display. The property is parsed, but it is not used.

verticalAlign

String

Read/write

Sets or retrieves the vertical alignment of the object.

visibility

String

Read/write

Sets or retrieves whether the content of the object is displayed.

whiteSpace

String

Read/write

Sets or retrieves a value that indicates whether lines are automatically broken inside the object.

width

String

Read/write

Sets or retrieves the width of the object.

Scripting Events

This element has no Scripting Events that Internet Explorer Mobile supports.

Scripting Methods

The following table shows items that Internet Explorer Mobile supports.

Method Arguments Comments

getAttribute

option

Syntax:

vAttrValue=style.getAttribute(sAttrName[,iFlags])

  • Returns the value of the specified attribute. If the attribute is not present then a NULL is returned.
    sAttrName is a String containing the name of the attribute.
    iFlags is an integer that specifies one or more of the following:
    0 (Default) Performs a property search that is not case-sensitive, and returns an interpolated value if the property is found.
    1 Performs a case-sensitive property search. To find a match, the uppercase and lowercase letters in sAttrName must exactly match those in the attribute name.
    2 Returns the value exactly as it was set in script or in the source document.

Scripting Collections

This element has no Scripting Collections that Internet Explorer Mobile supports.

Requirements

Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also

Concepts

Internet Explorer Mobile HTML Elements