HTML and CSS Reference
In-Depth Information
to
text/css
). The
src
attribute defines the location of the CSS document;
if it is a relative path, it is relative to the location of the referencing HTML
document.
HTML
<style>
element
You can use the HTML
<style>
element in the
<head>
of a document to
wrap CSS code to be applied to the document.
<head>
<style type=”text/css”>
[...]
</style>
</head>
The
type
attribute defines which language is used in the style sheet. It is
required for HTML4 and XHTML, but it is optional in HTML5 (defaulting to
text/css
).
HTML5 also defines a
scope
attribute that allows the
<style>
element
to be used inside a block of content, not just the head element.
note
@import
Rule
You can use the
@import
rule at the top of any block of CSS code or CSS
document to define another CSS document to be included into the
current document or code block. The
@import
rule must precede all other
rules in the document (with the exception of the proposed
@charset
rule
from CSS3).
@import “imported.css”