Pr.Pg Next Pg

<STYLE>..</STYLE> tag tutorials

  • The <STYLE> tag is used to define style information for an HTML document.

  • Inside the <STYLE> element you specify how HTML elements should render in a browser.

  • Each HTML document can contain multiple <STYLE> tags.

  • <STYLE> tag attributes are listed below:

 

Sr No

Attributes

Descriptions

1

type

This attribute is used to define the type of style sheet. The value of the attribute should be the MIME type of the style sheet language used. The most common current value for this attribute is text/css, which indicates a CSS format.

2

media

This attribute specifies the destination medium for the style information. The value of the attribute can be a single media descriptor, such as screen, or a comma-separated list.

Possible values for this attribute include all, aural, braille, print, projection, screen, and tv.

3

scoped

This attributes specifies that the styles only apply to this element's parent element and that element's child elements. If this attribute is not used, styles will be applied to the whole document.

 

  • The HTML <style> tag is supported by all major browsers like, Chrome, Firefox, Internet Explorer, Safari, Opera etc.

 

Syntax:

<head>

<syle element lists and it’s css property>

</style>

</head>

 

Example: HTML program to demonstrate style element

Output:
Pr.Pg border                                              Next Pg