- Styles Solve a Common Problem
- The line between content and presentation was blurred as Netscape and Internet Explorer began to add more tags and attributes to the original HTML specifications.
- The World Wide Web Consortium (W3C) created Styles in addition to HTML 4.0 to solve this problem.
- Style Sheets Can Save a Lot of Work
- Styles can be stored externally in CSS files
- Allows developers to control the style and layout of multiple Web pages all at once
- Multiple Styles Will Cascade Into One
- Style Sheets allow style information to be specified in many ways; inside a single HTML element, inside the <head> element, or in an external CSS file.
- Multiple external Style Sheets can be referenced inside a single HTML document.
- What style will be used when there is more than one style specified for an HTML element?
General Cascading Order
- Browser default
- External Style Sheet
- Internal Style Sheet (inside the <head> tag)
- Inline Style (inside HTML element)