A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it’s style. As always you use your (X)HTML file to arrange the content, but all of the presentation (fonts, colors, background, borders, text formatting, link effects & so on…) are accomplished within a CSS. At this point you have some choices of how to use the CSS, either internally or externally.
Internal Stylesheet
First we will explore the internal method. This way you are simply placing the CSS code within the <head></head> tags of each HTML file you want to style with the CSS. The format for this is shown in the example below.
<head>
<title><title>
<style type=”text/css”>
CSS Content Goes Here
</style>
</head>
<body>
External Stylesheet
A CSS file contains no HTML, only CSS. You simply save it with the .css file extension. You can link to the file externally by placing one of the following links in the head section of every HTML file you want to style with the CSS file
<link rel=”stylesheet” type=”text/css” href=“Path To stylesheet.css” />
CSS Syntax
It consists of only 3 parts.
selector { property: value }Ex:
body { background: #eeeeee;
0 nhận xét