![]() |
Web Accessibility AS/DSPS |
| Cuesta Home... DSPS... Web Access... Using CSS... Embedded CSS |
Embedded or internal style sheets are included within the head tags of standard HTML web pages. They apply only to a single page. In this example, the colors for the background and most text are set using the body, and the colors of the hyperlinks are also set.
<html>
<head>
<title> Using CSS </title>
<style type="text/css">
<!--
body { color: #000033;
background-color: #eeeeee }
a:active { color: #666699 }
a:hover { color: #3366ff }
a:link { color: $0066ff }
a:visited { color: #9966cc}
-->
</style>
</head>
<body>
the bulk of the web page would be here...
</body>
</html>
The style rules are enclosed within comment tags (<!-- and -->) to prevent them from being displayed.
A Class is a style that defines properties for some or all elements in a document. Classes are defined in within the header of internal style sheets. Then, the class attribute can be used to assign the special class to one or more elements on your web page. Here is an example with a regular paragraph and a bigger paragraph rule.
<style type="text/css">
<!--
p { font-family: Arial, Helvetica,
sans-serif; color: black }
p.bigger { font-family: Arial,
Helvetica, sans-serif; font-size: larger }
-->
</style>
To use the p.bigger class, you would include it within a paragraph tag, such as:
<p>This is a normal paragraph.</p>
<p class="bigger">This paragraph would be bigger!</p>