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
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 |
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árrafo en españ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:
- RTL: Right to left.
- LTR: Left to right.
Example:
Code begin
<q lang="he" dir="rtl">...a Hebrew quotation...</q>Code end
Specifies the style sheet language as a content type (e.g., "text/css").
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