Menu

CSS TUTORIALS - CSS - Inclusion

CSS - Inclusion

ADVERTISEMENTS


<head>
<style type="text/css" media="...">
Style Rules
............
</style>
</head>

ADVERTISEMENTS

Attributes:

AttributeValueDescription
type text/cssSpecifies the style sheet language as a content-type (MIME type). This is required attribute.
media screen
tty
tv
projection
handheld
print
braille
aural
all
Specifies the device the document will be displayed on. Default value is all. This is optional attribute.

ADVERTISEMENTS

Example:


<head>
<style type="text/css" media="all">
h1{
color: #36C;
}
</style>
</head>


<element style="...style rules....">

Attributes:

AttributeValueDescription
stylestyle rulesThe value of style attribute is a combination of style declarations separated by semicolon (;).

Example:


<h1 style ="color:#36C;"> This is inline CSS </h1>

This is inline CSS


<head>
<link type="text/css" href="..." media="..." />
</head>

Attributes:

AttributeValueDescription
typetext/cssSpecifies the style sheet language as a content-type (MIME type). This attribute is required.
hrefURLSpecifies the style sheet file having Style rules. This attribute is a required.
mediascreen
tty
tv
projection
handheld
print
braille
aural
all
Specifies the device the document will be displayed on. Default value is all. This is optional attribute.

Example:


h1, h2, h3 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}


<head>
<link type="text/css" href="mystyle.css" media="all" />
</head>


<head>
<@import "URL";
</head>


<head>
<@import url("URL");
</head>

Example:


<head>
@import "mystyle.css";
</head>


<style type="text/css">
<!--
body, td {
   color: blue;
}
-->
</style>

Example:


/* This is an external style sheet file */
h1, h2, h3 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}
/* end of style rules. */