PPT Slide
2.2 CSS : Cascading style sheets
- A CSS is a simple mechanism that allows author and readers to attch style to XML and HMTL documents.
- A CSS style sheet contains 5 basic types of presentation information, called properties :
1. Foreground and background colours and background images.
2. Font properties
3. Text properties (word / letter spacing)
4. Boxes (margins and borders around block elements, floating elements etc.)
5. Classifications (control over list styles, formatting of elements, etc.)
- Styles are suggestions to the browser and the effect of a style will depend largely upon the program that is interpreting it.
2.2.1 Style sheet inclusion
1. Use the <LINK> tag in the <HEAD> of the document.
<LINK REL=STYLESHEET TYPE=“text/css” HREF=“mystyle.css”>
2. Use the <STYLE> tag in the <HEAD> of the document.
<STYLE TYPE=“text/css”> H1 {color: red } </STYLE>
3. Directly in the STYLE attribute of the document (this is discouraged because it mixes style with content).
<H1 STYLE=“color: red”>A Title </H1>>