Style information
This element is used to enclose style sheet rules, and should only be used within the document head.
<style
dir="ltr | rtl"
lang="language code"
media="all | aural | braille | print |
projection | screen | tv"
title="text"
type="MIME type"‡
>
</style>
Key:
‡ = Required attribute
** = Transitional only
Explanation of attributes
dir: used to set the direction of the text in combination with the language set in the lang attribute. The available values are "ltr" (left to right) and "rtl" (right to left), with the default value being "ltr".
lang: used to indicate the language being used in the text contained within the element. The value of this attribute takes on the form of the ISO standard lanuage abbreviations found in RFC 3066. A list of these codes can be found on the ISO language codes page.
media: this attribute is used to specify the medium (or media) to which the enclosed style rules should be applied. The value of this attribute can comprise of a single medium, or a comma separated list of media, with values from the following: all, aural, braille, print, projection, screen, and tv, with each representing a different form of media that the document could be displayed with.
title: used to define an advisory text that may be displayed as a tooltip when a mouse is used to hover over the element.
type‡: this attribute is the MIME type of the particular style sheet language that is being used, with the most common value being text/css; the MIME type for Cascading Style Sheets.
Event handlers
The following event handlers are defined for this element:
- onclick
- ondbclick
- onkeydown
- onkeypress
- onkeyup
- onmousedown
- onmousemove
- onmouseout
- onmouseover
- onmouseup
Compatibility
Test | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|---|
Basic element support | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Attribute: dir | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Attribute: lang | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Attribute: media | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Attribute: title | ![]() |
![]() |
![]() |
![]() |
![]() |
? |
Attribute: type | ![]() |
![]() |
![]() |
![]() |
![]() |
? |
Key:
The browser icons are explained in the below list:
= Microsoft Internet Explorer 6+
= Netscape Communicator 4
= Mozilla and Netscape Navigator 6+
= Opera 7+
= MSN TV (aka. WebTV)
= Konqueror 3.0+
http://webpageworkshop.co.uk/main/xhtml10_element_style
Last updated: 31st May, 2004