Kyle Zimmermann
What are CSS? History The Box Model CSS Styles Rules and Selectors Cascade & Specificity Inheritance Video Demo
CSS stands for Cascading Style Sheet(s). The typical CSS file is a text file, extension.css Contains a series of commands called rules.
1994 – Hakon Wium Lie proposed idea 1996 – W3C recommended use of CSS1 1998 – CSS2 Absolute, relative positioning 2011 – CSS2.1 finally recommended by W3C Removed poorly supported or not fully functional features CSS3 Divided into modules
Separates structure from presentation Easy to maintain multiple pages Fast page loading Better accessibility for disabled users Improve search engine ranking High reusability
Interactive Box Model Interactive Box Model
External
Internal
Inline
Made up of a selector and declarations.
Type Selector h1 { font-family: Arial; size : 12 px; } Class Selector Joe Bill John .name { color: red; } ID Selector Intro text #intro { color: white; }
Determines which rule is applied. Specificity Hierarchy 1. Inline Styles 2. ID 3. Classes, attributes, pseudo-classes 4. Elements, pseudo-elements
Inheritance is the process by which CSS properties applied to one tag are passed on to nested tags. Text will be Arial </body
Writing rules Positioning