|
CSS stands for Cascading Style Sheets. A Style defines how to display HTML elements and Styles are normally
stored in Style Sheets. A Style Sheet allows you to control the display of a web document ( e.g. fonts, colors, typefaces etc.)
by separating the document's structure from the content of the document.
CSS is used to style the content and HTML is used to create the document structure.
With Cascading Style Sheets you can change the look of the page by making changes in the style sheet.
These changes will then take effect throughout the entire site.
Cascading Style Sheets make the site easier to maintain because when you make a change you are not going
to have to change each individual page. You only make the change in the Style Sheet.
External Style Sheets are stored in CSS files ( files having the extension .css). With CSS you can for example change the font style or color
for all of the pages on your web site just by editing one single CSS file.
There are a few ways that style sheets allow information to passed. Styles can be specified inside of a single HTML element, or inside of the <head> element in the HTML of
a web page, or in an external CSS file.
If more than one style is specified for an HTML element the order of prescedence is as follows.
1. Inline style (inside an HTML element)
<p style="font-size: 120%; color: green; ">Hello There</p">
2. Internal style sheet (inside the <HEAD> tag)
The text must be surrounded by <STYLE TYPE="text/css"> and </STYLE>
|
<HEAD>
<STYLE TYPE="text/css">
<!-- This is where your style sheet information goes -->
</STYLE>
</HEAD>
|
Style sheet information is started with <!-- and closed with --> and placed between the style tags
3. External style sheet
File ending with the .css extension
4. Browser default
What this means is that an inline style will overide a style declared in the <head> tag, external style sheet and the browser default.
|