René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

CSS (Cascading Style Sheets)

Including CSS in a html page

There are three ways to include CSS in a html page:
  • Inline
  • With the STYLE tag
  • External Styles

Inline

Inline styles allow to insert a specific style directly with the html-tag they're applied to:
<p style='font-family:Verdana'>some text</p>

Style Tag

Style tags are usually placed in the head part of the html document:
<html>
<head>
   <title>Some Title</title>
   <style type='text/css'> 
    <!--
      p  { color:blue; font-family:'Verdana'; }
      h1 { color:red;  font-family:'Verdana'; font-size:12px; }
    -->
    </style>
    </head>

   <body>
     <h1>Heading 1</h1>
     <p>Inside P</p>
   </body>
</html>

External Styles

<link rel='stylesheet' type='text/css' href='somestylesheets.css' />
Note, external style sheets are included by the link tag, not a style tag. Also, the included style sheet must not contain any html or style tags.

Other CSS things

Links