Textbook Notes (290,000)
CA (170,000)
McMaster (10,000)

COMPSCI 1BA3 Chapter Notes -Xhtml, Font, Railways Act 1921

Computer Science
Course Code

This preview shows page 1. to view the full 4 pages of the document.
Introducing Cascading Style Sheets
• One can efficiently format an unlimited number of Web pages with a consistent appearance.
• Advantages:
– Greater consistency in your Web site
– Easily modified code
– More flexible formatting
– Greater functionality
• Cross-browser support allows CSS to appear in all Web browsers without any differences.
Understanding How Styles Are Written
• A style is a consistent, recognizable pattern
• A CSS style is a collection of one or more rules
• A style sheet is a collection of styles
– combination of a selector, a property, and a value
– you can apply a style to an identified element
type selectors/element selctor(format XHTML elements),
-class selectors (used to select a specific XHTML element or format one or more elements on
a web page,
-id selectors( used to select uniquely format a single element on a web page)
-property describes how the selector will be modified
-each property and value pair (color:white) is called a declaration
-declaration list-the group of all the declarations
-paragraph format places all the CSS code on one or more lines as wrapping text
Working with color
• The colour property changes the foreground colour of an element
• The background-colour property changes the background colour of an element
• You can define colour in three ways:
– By name
– By their RGB triplet
– By a hexadecimal value
-avoid green-on-red, or red-on-green combinations
-hexadecimal system is based on the number 16, and uses the numbers 0-15. (0-9 is the
same, 10-15 is A to F)
-hexadecimal numbers as hex code
-short hex, you use just the first number or letter to enter each pair, but only if the pairs have
repeating characters (#FFFF00 to #FF0)
-web-safe colors, because all computer monitors should be able to display them correctly
Creating an Embedded Style Sheet
• An embedded style sheet is one in which the CSS code is written in the <head> section of an
XHTML document
You're Reading a Preview

Unlock to view full version