| body | { | color:rgb(160,160,160);
|
| | | background:rgb(0,0,40);
|
| | | margin-left:15%;
|
| | | margin-right:15%; }
|
| h1 | { | font-size:400%;
|
| | | font-family: "Vivaldi Italic", "Comic Sans MS";
|
| | | text-align:right;
|
| | | color:rgb(0,0,255);
|
| | | font-weight:900; }
|
| h3 | { | font-size:180%;
|
| | | color:rgb(255,0,200);
|
| | | text-align:center; }
|
| h4 | { | font-size:130%;
|
| | | font-style:italic;
|
| | | font-family: "Comic Sans MS";
|
| | | text-align:center;
|
| | | color:rgb(255,255,255); }
|
| p.cite | { | color:blue;
|
| | | text-align:right;
|
| | | margin-right:5%; }
|
| strong | { | color:red;
|
| | | font-weight:bold; }
|
| em.s | { | color:green;
|
| | | font-weight:bold; }
|
| em | { | color:blue;}
|
| u | { | color: yellow;
|
| | | font-weight:bold; }
|
| div.author | { | margin-left:-10%;
|
| | | color:rgb(0,150,0);
|
| | | font-family: "Comic Sans MS";
|
| | | text-align:right;
|
| | | font-size:150%;
|
| | | font-weight:300; }
|
Using Style Sheet Inside a Document
In the head section of this document, we have:
<head>
<meta name="Author" content="Chung-Chih Li">
<meta name="Date" content="3-12-02">
<title>Some Basic Style Sheet</title>
<style type="text/css">
h1 {font-size: 250%; font-weight:900; color:ff0000; text-align:center; }
h2 {font-size: 200%; font-weight:900; color:3333ff;}
h2.alt {font-size: 200%; font-weight:900; color:rgb(255,0,0);}
h3 {font-size: 125%; font-weight:900; color:00aa44;}
em {color:rgb(0,0,255); font-weight:900;}
strong {color:red}
div.tag
{ margin-left:10%;
margin-right:5%;
border:solid;
border-width:thin;
padding:0.5em;
color:black;
font-family: "Courier New Bold";
font-size:100%;
font-weight:900;
}
div.file
{ color:black;
background:white;
font-family: "Courier New Bold";
font-weight:900;
}
</style>
</head>
|
<h2> This is my h2. </h2>
|
| gives:
|
This is my h2.
|
<h2 class="alt"> This is my alternative h2. </h2>
|
| gives:
|
This is my alternative h2.
|