HTML and CSS Reference
In-Depth Information
Recall that the <link> tag creates a relationship between the current
document and some other document on the Web. In this example, we
tell the browser that the document named in the href attribute is a cas-
cading stylesheet ( css ), as indicated by the type attribute. Referencing
an external stylesheet in <link> requires that you include the href and
type attributes. We also tell the browser explicitly, albeit optionally, that
the file's relationship to our document is that it is a stylesheet , and we
provide a title making it available for later reference by the browser.
[ The <link> Header Element, 6.7.2 ]
The stylesheet-specifying <link> tag and its required href and type at-
tributes must appear in the <head> of a document. The URL of the
stylesheet may be absolute or relative to the document's base URL. Imported external stylesheets
The second technique for loading an external stylesheet imports the file
with a special command (a.k.a. at-rule ) within the <style> tag:
<title>Imported stylesheet</title>
<style type="text/css">
@import "";
body {background: url(backgrounds/marble.gif)}
The @import at-rule expects a single URL for the network path to the
external stylesheet. As shown in this example, the URL may be either
a string enclosed in double quotes and ending with a semicolon or the
Search WWH ::

Custom Search