Using CSS on HTML Document

Here is an example on how to use a CSS in your HTML document.  Stylesheet was applied to the document and table.

<html>
<head>
<title>CSS Demo</title>
<!– start of CSS –>
<style type=”text/css”>
document{
background-color: #CBCBCB;
}
table {
background: #7FFFD4;
border: 1px solid Black;
width: 500px;
font-family: “Arial Rounded MT Bold”;
border-color: Navy Blue;
border-top: medium double Black;
margin-left: auto;
margin-right: auto;
}
tbody{
background-color: White;
}
tr{
border-bottom-width: 1px;
text-align:center;
}
</style><!– end of the style –>
</head>
<body>
<table width=”200″ border=”1″ rules=”groups”>
<thead>
<tr>
<th>Heading for Column 1</th>
<th>Heading for Column 1</th>
<th>Heading for Column 1</th>
</tr>
</thead>
<tbody>
<tr>
<td>content</td>
<td>content</td>
<td>content</td>
</tr>
<tr>
<td>content</td>
<td>content</td>
<td>content</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Footer for Column 1</td>
<td>Footer for Column 1</td>
<td>Footer for Column 1</td>
</tr>
</tfoot>
</table>
</body>
</html>

Output Image:

css demo

css demo

Leave a Reply

Your email address will not be published. Required fields are marked *

*