an External Style Sheet Using a link Element or @import rule

Here’s an example of an external style sheet reference that uses a link element:

The link element, which must reside within the head element of an HTML document, links an external style sheet to the document. Multiple, comma-separated media types can be specified in the media attribute, for example, media=”screen,projection”. If it’s omitted, this attribute defaults to media=”screen”, according to the HTML4 specification, but in reality, browsers seem to apply media=”all” if the attribute is omitted.

Here’s an example of a style sheet reference that uses an @import rule:

The style element, like the link element, must reside within the head element. Relative URIs in the href attribute or @import rule are relative to the HTML document that contains the link. (When @import is used inside an external style sheet, relative URIs are relative to the importing style sheet.)

so what is media? actually, I don’t know what is media. But we specify the output media using the predefined media types.

Comments are closed.