Cascading Style Sheet
Learning Objectives
At the end of this chapter the students should be able to:
To use class selector to apply styles into html attributes.
To use style sheet to give all web pages of the websites the same format and layout.
To specify standard font, font color, font size, and others aspect of text
To create a style sheet that governs the total appearance of the whole website.
To specify the form styles of the web pages.
Introduction
What is CSS?
CSS stands for Cascading Style Sheets
Styles define how to display HTML elements
Styles are normally stored in Style Sheets
Styles were added to HTML 4.0 to solve a problem
External Style Sheets can save you a lot of work
External Style Sheets are stored in CSS files
Multiple style definitions will cascade into one
Style Sheets Can Save a Lot of Work
Styles sheets define HOW HTML elements are to be displayed, just like the font tag and the color attribute in HTML 3.2.
Styles are normally saved in external .css files.
External style sheets enable you to change the appearance and layout of all the pages in your Web, just by editing one single CSS document.
CSS is a breakthrough in Web design because it allows developers to control the style and layout of multiple Web pages all at once.
As a Web developer you can define a style for each HTML element and apply it to as many Web pages as you want.
To make a global change, simply change the style, and all elements in the Web are updated automatically.
Multiple Styles Will Cascade Into One
Style sheets allow style information to be specified in many ways.
Styles can be specified inside a single HTML element, inside the element of an HTML page, or in an external CSS file.
Even multiple external style sheets can be referenced inside a single HTML document.
Cascading Order
What style will be used when there is more than one style specified for an HTML element?
Generally speaking we can say that all