Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

<style>

<style
dir=ltr|rtr
lang=language
media=type
title=title
type=MIMEtype
</style>

Allows you to specify style information within the page. Information in the <style> tag overrides client defaults and linked style sheets. The end-tag is required.

Microsoft Internet Explorer supports most of the style sheet properties defined in the CSS1 specifications and some of those in the CSS2 specification. It is a very big topic so for a full description of the style properties you can use, see Using Style Sheets.

For example:

<html>

<head> <style> body {background: white; color: black} h1 {font: 8pt Arial bold} p {font: 10pt Arial; text-indent: 0.5in} a {text-decoration: none; color: blue} </style>
<body> <h1>The background color of this page is white. The color of text is black. This text, formatted with the heading one tag, is in 8-point Arial bold.</h1>
<p>This text is formatted with 10-point Arial and an indented margin of 0.5 inches.</p>
<p>The hyperlink created by the text <a href=> click here</a>appears in blue.</p>
<body> <html>

Attributes

dir=ltr|rtr

Specifies the direction of text. This can be left-to-right (ltr) or right-to-left (rtl). For example, English characters are presented left-to-right, Hebrew characters are presented right-to-left.

lang=language

Specifies which language the <style> tag uses. You can enter any valid ISO standard language abbreviation, for example, “en” for English, “de” for German and so on. For example, <span lang="es">hola! como esta?</span>.

This attribute helps search engines understand different languages as different languages rather than just misspelled English. It may also help spelling and grammar checkers and allow speech synthesizers to use language-dependent pronunciation rules.

media=type

Specifies which medium to want the style sheet to apply to:

Value…

Description…

Screen

This is the default. Applies to the screen

Print

For output to a printer

Projection

For projected presentations

Braille

For Braille devices

TTY

For character cell displays (uses fixed-width font)

TV

For televisions

All

For all devices

title=title

For information only. Some browsers display the title when you move the mouse over the tag (like a tool tip).

type=MIME type

Specifies the internet media (MIME) file type for the style information. It is <style type="text/css">.