SlideShare a Scribd company logo
1 of 11
WEBD 162
Week 5: Introduction to Cascading Style
Sheets (CSS)
CSS Evolution
CSS1: 1996
CSS2.1: 2011
CSS3: in progress
Why CSS?
• Separates web page “appearance” from content for easier
maintenance
• Reusable styles – use to unify pages in a web site
• DRY: Don’t Repeat Yourself
What does Cascading mean?
• Different levels of style sheets can be applied to HTML
• Default Browser style (User Agent)
• Most general: The default if there is no specific style sheet
• Author style
• Web page author creates a style sheet to give HTML a particular look
• Takes precedence over the Default Browser style
• Most common
• User style
• The end user creates their own style sheet to override Author and
Default Browser styles
• One reason might be to accommodate impaired vision (larger font)
• Least common
• See Figure 2-1 Hierarchy of Styles on p.86 of textbook
CSS: Cascading Style Sheets
• CSS is great because it separates style from structure
• Ex: If you wanted to change all h2 tags from red to blue
• Ex: www.csszengarden.com
• 3 ways to apply CSS
• In-line: single instance of a style
• Embedded: style for a single file declared in <head>
• External file: style for one or more files; linked in <head>
Anatomy of a CSS Rule
CSS Rules
• selector
• Which element is going to be affected?
• The rightmost part of selector is the type of element
• Everything to the left specifies which set of elements is affected
• declaration block
• There may be 0 or more declarations between the braces
• declaration
• Property
• Which property of the element gets affected
• Value
• How that property (attribute) gets affected
“Cascading” Style Sheets
• From least important to most important rules/style sheets:
1. User Agent (Browser)
2. User (You) style sheet
3. Author’s rules (Web page designer)
4. Author (Web page designer) !important declarations
5. User (You) !important declarations
• http://www.w3.org/TR/CSS2/cascade.html
• Note: CSS3 is not yet a formal standard
• http://www.sitepoint.com/web-foundations/cascade/
Minimize use of !important
• Using !important makes stylesheets hard to maintain
• Can make it hard to track down rule conflicts
• Useful in user stylesheets to accommodate users with
special needs (e.g. larger fonts for vision impairment)
• http://www.smashingmagazine.com/2010/11/02/the-
important-css-declaration-how-and-when-to-use-it/
• https://css-tricks.com/when-using-important-is-the-
right-choice/
Rule Inheritance
• Simple case:
• If a CSS rule for a selector is not specifically declared in
the web page or associated CSS file
• The CSS rule from the User Agent (browser) is inherited
Last Rule and Fallback Rule
• If a CSS rule appears multiple times on a web page
• Last rule in order of appearance takes effect
• Unless there is a rule with higher specificity
• If last rule cannot be applied, then next to last rule will take effect
• Progressive Enhancement 2.1 p. 104

More Related Content

What's hot

WordPress as a CMS (short version)
WordPress as a CMS (short version)WordPress as a CMS (short version)
WordPress as a CMS (short version)Stephanie Leary
 
Add Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress WebsiteAdd Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress WebsiteDustin Hartzler
 
Adobe Dreamweaver CS5 Basics
Adobe Dreamweaver CS5 BasicsAdobe Dreamweaver CS5 Basics
Adobe Dreamweaver CS5 BasicsDouglas Strahler
 
160712 wiki lecture
160712 wiki lecture160712 wiki lecture
160712 wiki lecturein2acous
 
Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)MHR11
 
CSS Stylesheet Training
CSS Stylesheet TrainingCSS Stylesheet Training
CSS Stylesheet TrainingSTR Software
 
UReach drupal-basic-training-2013
UReach drupal-basic-training-2013UReach drupal-basic-training-2013
UReach drupal-basic-training-2013Andy Smith
 
Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Likitha47
 
Drupal: Organizing Content for Multiple Audiences
Drupal: Organizing Content for Multiple AudiencesDrupal: Organizing Content for Multiple Audiences
Drupal: Organizing Content for Multiple AudiencesiFactory
 
presentation in html,css,javascript
presentation in html,css,javascriptpresentation in html,css,javascript
presentation in html,css,javascriptFaysalAhammed5
 
I Blog, You Blog, Weblog
I Blog, You Blog, WeblogI Blog, You Blog, Weblog
I Blog, You Blog, WeblogMichael Sauers
 
Evaluating your stylesheets
Evaluating your stylesheetsEvaluating your stylesheets
Evaluating your stylesheetsKoji Ishimoto
 
HTML5 for ASP.NET Developers
HTML5 for ASP.NET DevelopersHTML5 for ASP.NET Developers
HTML5 for ASP.NET DevelopersJustin Lee
 
WordPress block editor v0.0.0
WordPress block editor v0.0.0WordPress block editor v0.0.0
WordPress block editor v0.0.0Herb Miller
 
The 3Cs of WordPress
The 3Cs of WordPressThe 3Cs of WordPress
The 3Cs of WordPressDavid Tufts
 

What's hot (20)

Drupal - Introduction to Drupal Template Design
Drupal - Introduction to Drupal Template DesignDrupal - Introduction to Drupal Template Design
Drupal - Introduction to Drupal Template Design
 
WordPress as a CMS (short version)
WordPress as a CMS (short version)WordPress as a CMS (short version)
WordPress as a CMS (short version)
 
Add Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress WebsiteAdd Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress Website
 
Adobe Dreamweaver CS5 Basics
Adobe Dreamweaver CS5 BasicsAdobe Dreamweaver CS5 Basics
Adobe Dreamweaver CS5 Basics
 
160712 wiki lecture
160712 wiki lecture160712 wiki lecture
160712 wiki lecture
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)
 
Introduction to HTML5 and CSS3
Introduction to HTML5 and CSS3Introduction to HTML5 and CSS3
Introduction to HTML5 and CSS3
 
Web
WebWeb
Web
 
CSS Stylesheet Training
CSS Stylesheet TrainingCSS Stylesheet Training
CSS Stylesheet Training
 
UReach drupal-basic-training-2013
UReach drupal-basic-training-2013UReach drupal-basic-training-2013
UReach drupal-basic-training-2013
 
Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01Howcssworks 100207024009-phpapp01
Howcssworks 100207024009-phpapp01
 
Drupal: Organizing Content for Multiple Audiences
Drupal: Organizing Content for Multiple AudiencesDrupal: Organizing Content for Multiple Audiences
Drupal: Organizing Content for Multiple Audiences
 
presentation in html,css,javascript
presentation in html,css,javascriptpresentation in html,css,javascript
presentation in html,css,javascript
 
I Blog, You Blog, Weblog
I Blog, You Blog, WeblogI Blog, You Blog, Weblog
I Blog, You Blog, Weblog
 
Evaluating your stylesheets
Evaluating your stylesheetsEvaluating your stylesheets
Evaluating your stylesheets
 
HTML5 for ASP.NET Developers
HTML5 for ASP.NET DevelopersHTML5 for ASP.NET Developers
HTML5 for ASP.NET Developers
 
WordPress block editor v0.0.0
WordPress block editor v0.0.0WordPress block editor v0.0.0
WordPress block editor v0.0.0
 
The 3Cs of WordPress
The 3Cs of WordPressThe 3Cs of WordPress
The 3Cs of WordPress
 
Css intro
Css introCss intro
Css intro
 

Similar to WEBD 162: Intro to CSS

Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxTanu524249
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSJer Clarke
 
INFT132 093 05 Cascading Style Sheets
INFT132 093 05 Cascading Style SheetsINFT132 093 05 Cascading Style Sheets
INFT132 093 05 Cascading Style SheetsMichael Rees
 
Introduction to cascade style sheets CSS.pdf
Introduction to cascade style sheets CSS.pdfIntroduction to cascade style sheets CSS.pdf
Introduction to cascade style sheets CSS.pdfMahmoud268161
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)Harshita Yadav
 
using cascading style sheets-presentation.ppt
using cascading style sheets-presentation.pptusing cascading style sheets-presentation.ppt
using cascading style sheets-presentation.pptKADAMBARIPUROHIT
 
css-presentation-for mid career engineers.ppt
css-presentation-for mid career engineers.pptcss-presentation-for mid career engineers.ppt
css-presentation-for mid career engineers.pptmohamed abd elrazek
 
Stupid Index Block Tricks
Stupid Index Block TricksStupid Index Block Tricks
Stupid Index Block Trickshannonhill
 
Std 12 Computer Chapter 2 Cascading Style Sheets and Javascript(Part 1 CSS)
Std 12 Computer Chapter 2 Cascading Style Sheets  and Javascript(Part 1 CSS)Std 12 Computer Chapter 2 Cascading Style Sheets  and Javascript(Part 1 CSS)
Std 12 Computer Chapter 2 Cascading Style Sheets and Javascript(Part 1 CSS)Nuzhat Memon
 
Web programming css
Web programming cssWeb programming css
Web programming cssUma mohan
 
howcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptxhowcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptxRavneetSingh343801
 

Similar to WEBD 162: Intro to CSS (20)

DHTML
DHTMLDHTML
DHTML
 
CSS Bootstrap.pdf
CSS  Bootstrap.pdfCSS  Bootstrap.pdf
CSS Bootstrap.pdf
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSS
 
INFT132 093 05 Cascading Style Sheets
INFT132 093 05 Cascading Style SheetsINFT132 093 05 Cascading Style Sheets
INFT132 093 05 Cascading Style Sheets
 
Introduction to cascade style sheets CSS.pdf
Introduction to cascade style sheets CSS.pdfIntroduction to cascade style sheets CSS.pdf
Introduction to cascade style sheets CSS.pdf
 
Css
CssCss
Css
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
using cascading style sheets-presentation.ppt
using cascading style sheets-presentation.pptusing cascading style sheets-presentation.ppt
using cascading style sheets-presentation.ppt
 
css-presentation-for mid career engineers.ppt
css-presentation-for mid career engineers.pptcss-presentation-for mid career engineers.ppt
css-presentation-for mid career engineers.ppt
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
 
Stupid Index Block Tricks
Stupid Index Block TricksStupid Index Block Tricks
Stupid Index Block Tricks
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
 
Std 12 Computer Chapter 2 Cascading Style Sheets and Javascript(Part 1 CSS)
Std 12 Computer Chapter 2 Cascading Style Sheets  and Javascript(Part 1 CSS)Std 12 Computer Chapter 2 Cascading Style Sheets  and Javascript(Part 1 CSS)
Std 12 Computer Chapter 2 Cascading Style Sheets and Javascript(Part 1 CSS)
 
Web programming css
Web programming cssWeb programming css
Web programming css
 
css_1.ppt
css_1.pptcss_1.ppt
css_1.ppt
 
howcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptxhowcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptx
 

Recently uploaded

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 

Recently uploaded (20)

9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 

WEBD 162: Intro to CSS

  • 1. WEBD 162 Week 5: Introduction to Cascading Style Sheets (CSS)
  • 2. CSS Evolution CSS1: 1996 CSS2.1: 2011 CSS3: in progress
  • 3. Why CSS? • Separates web page “appearance” from content for easier maintenance • Reusable styles – use to unify pages in a web site • DRY: Don’t Repeat Yourself
  • 4. What does Cascading mean? • Different levels of style sheets can be applied to HTML • Default Browser style (User Agent) • Most general: The default if there is no specific style sheet • Author style • Web page author creates a style sheet to give HTML a particular look • Takes precedence over the Default Browser style • Most common • User style • The end user creates their own style sheet to override Author and Default Browser styles • One reason might be to accommodate impaired vision (larger font) • Least common • See Figure 2-1 Hierarchy of Styles on p.86 of textbook
  • 5. CSS: Cascading Style Sheets • CSS is great because it separates style from structure • Ex: If you wanted to change all h2 tags from red to blue • Ex: www.csszengarden.com • 3 ways to apply CSS • In-line: single instance of a style • Embedded: style for a single file declared in <head> • External file: style for one or more files; linked in <head>
  • 6. Anatomy of a CSS Rule
  • 7. CSS Rules • selector • Which element is going to be affected? • The rightmost part of selector is the type of element • Everything to the left specifies which set of elements is affected • declaration block • There may be 0 or more declarations between the braces • declaration • Property • Which property of the element gets affected • Value • How that property (attribute) gets affected
  • 8. “Cascading” Style Sheets • From least important to most important rules/style sheets: 1. User Agent (Browser) 2. User (You) style sheet 3. Author’s rules (Web page designer) 4. Author (Web page designer) !important declarations 5. User (You) !important declarations • http://www.w3.org/TR/CSS2/cascade.html • Note: CSS3 is not yet a formal standard • http://www.sitepoint.com/web-foundations/cascade/
  • 9. Minimize use of !important • Using !important makes stylesheets hard to maintain • Can make it hard to track down rule conflicts • Useful in user stylesheets to accommodate users with special needs (e.g. larger fonts for vision impairment) • http://www.smashingmagazine.com/2010/11/02/the- important-css-declaration-how-and-when-to-use-it/ • https://css-tricks.com/when-using-important-is-the- right-choice/
  • 10. Rule Inheritance • Simple case: • If a CSS rule for a selector is not specifically declared in the web page or associated CSS file • The CSS rule from the User Agent (browser) is inherited
  • 11. Last Rule and Fallback Rule • If a CSS rule appears multiple times on a web page • Last rule in order of appearance takes effect • Unless there is a rule with higher specificity • If last rule cannot be applied, then next to last rule will take effect • Progressive Enhancement 2.1 p. 104