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.
8.1.4.2. 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:
<head>
<title>Imported stylesheet</title>
<style type="text/css">
<!--
@import
url(http://www.kumquats.com/styles/gen_styles.css);
@import "http://www.kumquats.com/styles/spec_styles.css";
body {background: url(backgrounds/marble.gif)}
-->
</style>
</head>
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