CodeAve.com CodeAve.com - CSS - Basics
ASP
JavaScript
CSS
·Basics
·Page Display
·Text Display
·Script Writers
·Contents
·What's New?
HTML
Maps
Links
Mail List
Search
Sitemap


 


Style Sheet Defined within Document Header
Style sheets can be imported, linked, be in-line, or be defined in the document header. While most sites will only use one style sheet and link it to all of their documents, thus facilitating easy changes across many pages. There will be instances where you may want a page to stand out or try something different and not want multiple documents dictating the how one page is going to look. The example below will define the page color to while and some attributes to all the hyperlinks on the page. Most important to note is the convention it is written in and that CSS should be enclosed within HTML comments for non CSS browsers.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<head>
<title>CodeAve.com/CSS - Style Sheet Defined within Document Header</title>
<style type="text/css">
<!--
body {background: #FFFFFF; /* The background of the page will be colored white */}
a:link {color: #000000; /* All unvisited links will be colored black */ }
a:visited {color: #FF9900; /* All visited links will be colored tan */ }
a:active {color: #FF0000; /* All active links will be colored red */}
a:hover {color: #0000FF; background: #FFFF00;}
/* When the mouse pointer is over the link the link will be colored blue
and the background color of the link will change to yellow */
-->
</style>

</head>

<body>
<center>

<a href="http://www.yahoo.com">Yahoo.com</a> | 
<a href="http://www.lycos.com">Lycos.com</a> | 
<a href="http://www.excite.com">Excite.com</a> | 
<a href="http://www.ask.com">Ask.com</a> | 
<a href="http://www.about.com">About.com</a> | 
<a href="http://www.jimmievaughan.com">Jimmie Vaughan.com</a>

</center>
</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
Maps: Map Script Writers | Bing Maps | Google Maps
Privacy Statement

CodeAve.com is hosted by MyHosting.com
Donate Food Online with a Mouse Click at TheHungerSite.com
Donate Land Online with a Mouse Click at TheRainForestSite.com
© 1999 - 2010 CodeAve.com
All Rights Reserved