Versión en español




HTML style tag


Note: If you don't know what a tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.

Description

The HTML style tag provides a way to define style rules within the document's HTML head tag. The style rules may help authors to set visual attributes to the elements.

Example:

Code begin <head>
<style type="text/css">
p {font-size: 8pt; font-family: arial,helvetica}
p.big {font-size: 12pt; font-family: arial,helvetica}
</style>
</head>Code end


Style information may also be defined in an external file with the help of the HTML link tag.

Attributes

title (text)

Indicates a title for the element. Used to give a short description about the element that is usually shown as a "tool tip" when the user put the mouse pointer over the element.

Example:

Code View
<a title="HTMLQuick.com" href="http://www.htmlquick.com">HTML code</a> HTML code

lang (langcode)

Specifies the language of an element's content. The default value in "unknown".

When writing XHTML code the syntax "xml:lang" represents a preferred alternative in XHTML 1.0 and a replacement in XHTML 1.1 (e.g., xml:lang="en").

Example:

Code begin <p lang="en">This is a paragraph in english.</p>
<p lang="es">Este es un p&aacute;rrafo en espa&ntilde;ol.</p>Code end


dir

Specifies the text direction of the element's contents and attribute values, as well as tables directionality. It has two possible values that are case insensitive:
Example:

Code begin <q lang="he" dir="rtl">...a Hebrew quotation...</q>Code end


type (content-type)

Specifies the style sheet language as a content type (e.g., "text/css").

media (media-descriptor)

Specifies the media for which the style information has been designed. It may be a single media or a comma-separated list of them. The default value is "screen".

Example:

Code begin <style type="text/css" media="print">
...style definitions...
</style>Code end



Events

There are no events defined for this tag.

See complete list and information about events in HTML




Bypass footer options  |   Send to a friend Send to a friend  |  Post to del.icio.us Post to del.icio.us

Digg this page Digg this!  |  File on Furl File on Furl  |  Add to Yahoo! MyWeb Add to Yahoo! MyWeb

Bypass W3C declarations | 

Valid XHTML 1.0 Strict  |  Valid CSS Why should you trust us? Click the images on the left to see how seriously we write our own pages, then make your choice.

Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0. This website gives its best effort to achieve the Level Triple-A Conformance, W3C-WAI Web Content Accessibility Guidelines 1.0. If you find any detail or error that we didn't see, don't hesitate and let us know.

The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. -- Tim Berners-Lee, W3C Director and inventor of the World Wide Web.

 Link to us  |  Contact us  |  Beyond HTML  |  Tools and resources  |  Sitemap  |  Webmaster