Introduction to CSS
- It is now possible to comfortably hand-write web pages again. Cascading Style Sheets allow richly-formatted web sites to have simple and elegant HTML. This is possible because CSS allows for the separation of structure and formatting.
- CSS advantages: Save authoring and editing time, save file size, and save money.
- The old FONT tag is now deprecated. CSS replaces that HTML element completely.
- Web sites used to require tables to create multi-column layouts. CSS does away with this requirement, resulting in an enormous simplification of the HTML code.
- The basic elements of any web page are H1, H2, P, UL, OL, DIV, and so on. Believe it or not, this is nearly the sum total of all the markup that most web pages need.
Structural Markup
- "Structural markup" is using the HTML elements to describe what the parts of a web site actually do, not how they look.
- Structural markup makes writing HTML easier.
- Structural markup is important for devices other than web browsers, such as handheld computers and screen readers for the blind. It also improves search engine results.
Style Sheet
- Style sheets can define how the basic HTML elements should be displayed in a browser. A style sheet will typically define the appearance of P, H1, H2, LI, and so on.
- Style sheets make it possible to completely transform a page without editing the HTML.
Embedded versus External
- The power of the style sheet is that one document controls the layout for the entire project.
- External style sheets are invoked using the LINK element and/or the @IMPORT declaration.
Browser support
- Not all web browsers are created equal. Some support CSS better than others. The difficulty comes in with CSS layout — it can break on older browsers.
- Mozilla provides the most robust support for CSS. Internet Explorer is the weakest.