SlideShare a Scribd company logo
1 of 15
INFT11/71-132
       Web Applications


Cascading Style Sheets
        Dr Michael Rees
  School of Information Technology

        mrees@bond.edu.au
Semantics and Presentation

• HTML markup represents:
   – Semantics: <h1> means that an element is a top-
     level heading
   – Presentation: <h1> elements look a certain way

• Separate semantics from presentation:
   – Easier to present on multiple platforms (browser,
     cell phone, spoken, …)
   – Easier to generate documents with consistent look
   – Semantic and presentation defined independently
     (division of labor)
   – User control of presentation is facilitated
© 2009 Michael Rees                Web Applications   2
Cascading Style Sheets

• Styles sheets define how HTML elements are to be
  displayed

• Styles are normally saved in external style sheets
  (.css files)

• External style sheets enable you to change the
  appearance and layout of all the pages in your site,
  just by editing one single CSS document!




© 2009 Michael Rees                Web Applications    3
CSS - Introduction

• Cascading style sheets improve page load time for
  your site as there is less data to transfer

• Normally, a browser has to download all of your
  formatting code in each and every one of your pages
  on your site

• With CSS, the style sheet is downloaded once and
  cached, and every page request-response cycle after
  the first page is shorter




© 2009 Michael Rees                 Web Applications   4
Cascading Style Sheets

• CSS is a vendor-neutral standard defined by the W3C
  (World Wide Web Consortium)

• CSS added to HTML 4.0

• CSS is an extension to HTML to give web site
  developers fine control over page content display

• CSS offers much more control over content than
  HTML tags alone

• CSS is supported by all major browsers

• CSS uses common (electronic) publishing terminology
© 2009 Michael Rees                Web Applications   5
CSS Style Sheet Types
• External (Linked) style sheet:
   – Style rules stored in separate .css file
   – A single .css file can be linked to any number of pages
   – A single page can link to many external style sheets
• Embedded (Internal) style sheet:
   – Stored in the <head> tag of the page
   – Enclosed in <style> … </style> tags
   – Affects only that page
   – Overrides external style sheet
• Inline style:
    – Specified in style attribute in individual HTML tags
    – Applies only to that tag
    – Overrides external and embedded style sheets
• All 3 types of style sheets can be cascaded (mixed) in a single page

© 2009 Michael Rees                  Web Applications              6
Cascading Order
• What style will be used when there is more than one
  style specified for an HTML tag?
• All the styles will ‘cascade’ into a new ‘virtual’ style
  sheet in the following priority order:
     1. Inline style (inside an HTML tag)
     2. Embedded style sheet (inside the <head> tag)
     3. External style sheet(s); last sheet linked in page
        takes precedence
     4. Browser default style sheet




© 2009 Michael Rees                Web Applications   7
CSS Notation

• CSS uses simple declarative syntax to specify a
  collection of style rules to control the layout and
  typography a page

       http://www.w3schools.com/css/




© 2009 Michael Rees                  Web Applications   8
Style Rule Syntax
• A CSS style rule is made up
  of two parts:
                                                       Example rule:
   – Selector: the part of                                 H1 { color: red }
      HTML in the page that
      CSS style modifies
   – Declaration: style setting                  Selector
      applied to selector, again                                 Declaration
      in two parts:
        • property name                                H1 { color: red }

        • property value
                                                        Name          Value



© 2009 Michael Rees                 Web Applications                           9
CSS Selectors
• Single element type:



• Multiple element types:



• All element types:



• Specific elements by id:


© 2009 Michael Rees              Web Applications   10
Class Selector
• Elements belonging to a style class:


          – Referencing a style class in HTML:



• Elements of a certain type and class:




© 2009 Michael Rees               Web Applications   11
Link Pseudo-Classes

• a:link {color:#FF0000}           /* unvisited link */

• a:visited {color:#00FF00} /* visited link */

• a:hover {color:#FF00FF} /* mouse over link */

• a:active {color:#0000FF} /* selected link */




© 2009 Michael Rees                Web Applications       12
CSS Colour

  • CSS measures colour in two ways, either by a colour
    name (like ‘blue’) or by numerical RGB specification:
    #99CCFF - hexadecimal for sky blue

  • http://www.w3schools.com/css/css_colors.asp




© 2009 Michael Rees                Web Applications   13
Cascading Style Sheets

• For inspiration, an essential visit:
   – CSS Zen Garden

• Validate your CSS code with:
   – The W3C CSS Validation Service

• Learn the basics of CSS with:
   – W3Schools, CSS Tutorial




© 2009 Michael Rees                Web Applications   14
Resources

• Read Chapter 3 of textbook




© 2009 Michael Rees               Web Applications   15

More Related Content

What's hot

What's hot (20)

Css ms megha
Css ms meghaCss ms megha
Css ms megha
 
Steph's Html5 and css presentation
Steph's Html5 and css presentationSteph's Html5 and css presentation
Steph's Html5 and css presentation
 
Teaching presentation
Teaching presentationTeaching presentation
Teaching presentation
 
Html
HtmlHtml
Html
 
Front End development of biological database
Front End development of biological databaseFront End development of biological database
Front End development of biological database
 
N5 CSS
N5 CSSN5 CSS
N5 CSS
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Universal CSS - Betsy Granger - ebookcraft 2018
Universal CSS - Betsy Granger - ebookcraft 2018Universal CSS - Betsy Granger - ebookcraft 2018
Universal CSS - Betsy Granger - ebookcraft 2018
 
Open source wordpress and drupal
Open source wordpress and drupalOpen source wordpress and drupal
Open source wordpress and drupal
 
2. เมนูของ ms word 2007
2. เมนูของ ms word 20072. เมนูของ ms word 2007
2. เมนูของ ms word 2007
 
Prerequisites of Bootstrap
Prerequisites of BootstrapPrerequisites of Bootstrap
Prerequisites of Bootstrap
 
Working with Mediawiki
Working with MediawikiWorking with Mediawiki
Working with Mediawiki
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
HTML-First at Wiley - Tzviya Siegman & Benjamin Young - ebookcraft 2018
HTML-First at Wiley - Tzviya Siegman & Benjamin Young - ebookcraft 2018HTML-First at Wiley - Tzviya Siegman & Benjamin Young - ebookcraft 2018
HTML-First at Wiley - Tzviya Siegman & Benjamin Young - ebookcraft 2018
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
Web Development
Web DevelopmentWeb Development
Web Development
 
Ppt ch10
Ppt ch10Ppt ch10
Ppt ch10
 
Ppt ch11
Ppt ch11Ppt ch11
Ppt ch11
 
Css present
Css presentCss present
Css present
 
Xhtml and html5 basics
Xhtml and html5 basicsXhtml and html5 basics
Xhtml and html5 basics
 

Similar to CSS-Web Apps

Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation Salman Memon
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxalvindalejoyosa1
 
Web technologies-course 04.pptx
Web technologies-course 04.pptxWeb technologies-course 04.pptx
Web technologies-course 04.pptxStefan Oprea
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxTanu524249
 
2 introduction css
2 introduction css2 introduction css
2 introduction cssJalpesh Vasa
 
CSS Stylesheet Training
CSS Stylesheet TrainingCSS Stylesheet Training
CSS Stylesheet TrainingSTR Software
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdfwubiederebe1
 
howcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptxhowcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptxRavneetSingh343801
 
Slides-Online-Week2-Website-Frontend-CSS.pptx
Slides-Online-Week2-Website-Frontend-CSS.pptxSlides-Online-Week2-Website-Frontend-CSS.pptx
Slides-Online-Week2-Website-Frontend-CSS.pptxahmadraza72678
 
WEBD 162: Intro to CSS
WEBD 162: Intro to CSSWEBD 162: Intro to CSS
WEBD 162: Intro to CSSpalomateach
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...JebaRaj26
 

Similar to CSS-Web Apps (20)

CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
DHTML
DHTMLDHTML
DHTML
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
 
CSS Bootstrap.pdf
CSS  Bootstrap.pdfCSS  Bootstrap.pdf
CSS Bootstrap.pdf
 
Week11 Lecture: CSS
Week11 Lecture: CSSWeek11 Lecture: CSS
Week11 Lecture: CSS
 
Web technologies-course 04.pptx
Web technologies-course 04.pptxWeb technologies-course 04.pptx
Web technologies-course 04.pptx
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
 
Css
CssCss
Css
 
2 introduction css
2 introduction css2 introduction css
2 introduction css
 
CSS Stylesheet Training
CSS Stylesheet TrainingCSS Stylesheet Training
CSS Stylesheet Training
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
Pertemuan 7
Pertemuan 7Pertemuan 7
Pertemuan 7
 
howcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptxhowcssworks-100207024009-phpapp01.pptx
howcssworks-100207024009-phpapp01.pptx
 
Slides-Online-Week2-Website-Frontend-CSS.pptx
Slides-Online-Week2-Website-Frontend-CSS.pptxSlides-Online-Week2-Website-Frontend-CSS.pptx
Slides-Online-Week2-Website-Frontend-CSS.pptx
 
WEBD 162: Intro to CSS
WEBD 162: Intro to CSSWEBD 162: Intro to CSS
WEBD 162: Intro to CSS
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 

More from Michael Rees

Activity 25 reflecting on openness
Activity 25 reflecting on opennessActivity 25 reflecting on openness
Activity 25 reflecting on opennessMichael Rees
 
Experiences with MOOCs: Challenges and Opportunities
Experiences with MOOCs: Challenges and OpportunitiesExperiences with MOOCs: Challenges and Opportunities
Experiences with MOOCs: Challenges and OpportunitiesMichael Rees
 
Messing with MOOCs
Messing with MOOCsMessing with MOOCs
Messing with MOOCsMichael Rees
 
Developing Inside the Cloud
Developing Inside the CloudDeveloping Inside the Cloud
Developing Inside the CloudMichael Rees
 
ABC Gold Coast Social Media Talk
ABC Gold Coast Social Media TalkABC Gold Coast Social Media Talk
ABC Gold Coast Social Media TalkMichael Rees
 
Virtualisation advances for teaching and research
Virtualisation advances for teaching and researchVirtualisation advances for teaching and research
Virtualisation advances for teaching and researchMichael Rees
 
Building Classroom Community
Building Classroom CommunityBuilding Classroom Community
Building Classroom CommunityMichael Rees
 
Teaching with Social Media
Teaching with Social MediaTeaching with Social Media
Teaching with Social MediaMichael Rees
 
Teaching with Social Media
Teaching with Social MediaTeaching with Social Media
Teaching with Social MediaMichael Rees
 
Cloud Apps Ascent - Snapshot
Cloud Apps Ascent - SnapshotCloud Apps Ascent - Snapshot
Cloud Apps Ascent - SnapshotMichael Rees
 
Cloud Apps Survival Of The Fittest
Cloud Apps   Survival Of The FittestCloud Apps   Survival Of The Fittest
Cloud Apps Survival Of The FittestMichael Rees
 
INFT132 093 07 Document Object Model
INFT132 093 07 Document Object ModelINFT132 093 07 Document Object Model
INFT132 093 07 Document Object ModelMichael Rees
 
INFT132 093 03 Web Concepts
INFT132 093 03 Web ConceptsINFT132 093 03 Web Concepts
INFT132 093 03 Web ConceptsMichael Rees
 
INFT132 093 02 Internet Concepts
INFT132 093 02 Internet ConceptsINFT132 093 02 Internet Concepts
INFT132 093 02 Internet ConceptsMichael Rees
 
Get Connected - Building a Social Media Roadmap
Get Connected - Building a Social Media RoadmapGet Connected - Building a Social Media Roadmap
Get Connected - Building a Social Media RoadmapMichael Rees
 
Favourite Cloud Apps
Favourite Cloud AppsFavourite Cloud Apps
Favourite Cloud AppsMichael Rees
 
Screencasting to Enhance Teaching Materials
Screencasting to Enhance Teaching MaterialsScreencasting to Enhance Teaching Materials
Screencasting to Enhance Teaching MaterialsMichael Rees
 
QCEC2009 Virtual IT Teaching Laboratory
QCEC2009 Virtual IT Teaching LaboratoryQCEC2009 Virtual IT Teaching Laboratory
QCEC2009 Virtual IT Teaching LaboratoryMichael Rees
 
Screencasting At Bond
Screencasting At BondScreencasting At Bond
Screencasting At BondMichael Rees
 

More from Michael Rees (20)

Activity 25 reflecting on openness
Activity 25 reflecting on opennessActivity 25 reflecting on openness
Activity 25 reflecting on openness
 
Experiences with MOOCs: Challenges and Opportunities
Experiences with MOOCs: Challenges and OpportunitiesExperiences with MOOCs: Challenges and Opportunities
Experiences with MOOCs: Challenges and Opportunities
 
MOOCs march on
MOOCs march onMOOCs march on
MOOCs march on
 
Messing with MOOCs
Messing with MOOCsMessing with MOOCs
Messing with MOOCs
 
Developing Inside the Cloud
Developing Inside the CloudDeveloping Inside the Cloud
Developing Inside the Cloud
 
ABC Gold Coast Social Media Talk
ABC Gold Coast Social Media TalkABC Gold Coast Social Media Talk
ABC Gold Coast Social Media Talk
 
Virtualisation advances for teaching and research
Virtualisation advances for teaching and researchVirtualisation advances for teaching and research
Virtualisation advances for teaching and research
 
Building Classroom Community
Building Classroom CommunityBuilding Classroom Community
Building Classroom Community
 
Teaching with Social Media
Teaching with Social MediaTeaching with Social Media
Teaching with Social Media
 
Teaching with Social Media
Teaching with Social MediaTeaching with Social Media
Teaching with Social Media
 
Cloud Apps Ascent - Snapshot
Cloud Apps Ascent - SnapshotCloud Apps Ascent - Snapshot
Cloud Apps Ascent - Snapshot
 
Cloud Apps Survival Of The Fittest
Cloud Apps   Survival Of The FittestCloud Apps   Survival Of The Fittest
Cloud Apps Survival Of The Fittest
 
INFT132 093 07 Document Object Model
INFT132 093 07 Document Object ModelINFT132 093 07 Document Object Model
INFT132 093 07 Document Object Model
 
INFT132 093 03 Web Concepts
INFT132 093 03 Web ConceptsINFT132 093 03 Web Concepts
INFT132 093 03 Web Concepts
 
INFT132 093 02 Internet Concepts
INFT132 093 02 Internet ConceptsINFT132 093 02 Internet Concepts
INFT132 093 02 Internet Concepts
 
Get Connected - Building a Social Media Roadmap
Get Connected - Building a Social Media RoadmapGet Connected - Building a Social Media Roadmap
Get Connected - Building a Social Media Roadmap
 
Favourite Cloud Apps
Favourite Cloud AppsFavourite Cloud Apps
Favourite Cloud Apps
 
Screencasting to Enhance Teaching Materials
Screencasting to Enhance Teaching MaterialsScreencasting to Enhance Teaching Materials
Screencasting to Enhance Teaching Materials
 
QCEC2009 Virtual IT Teaching Laboratory
QCEC2009 Virtual IT Teaching LaboratoryQCEC2009 Virtual IT Teaching Laboratory
QCEC2009 Virtual IT Teaching Laboratory
 
Screencasting At Bond
Screencasting At BondScreencasting At Bond
Screencasting At Bond
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 

Recently uploaded (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 

CSS-Web Apps

  • 1. INFT11/71-132 Web Applications Cascading Style Sheets Dr Michael Rees School of Information Technology mrees@bond.edu.au
  • 2. Semantics and Presentation • HTML markup represents: – Semantics: <h1> means that an element is a top- level heading – Presentation: <h1> elements look a certain way • Separate semantics from presentation: – Easier to present on multiple platforms (browser, cell phone, spoken, …) – Easier to generate documents with consistent look – Semantic and presentation defined independently (division of labor) – User control of presentation is facilitated © 2009 Michael Rees Web Applications 2
  • 3. Cascading Style Sheets • Styles sheets define how HTML elements are to be displayed • Styles are normally saved in external style sheets (.css files) • External style sheets enable you to change the appearance and layout of all the pages in your site, just by editing one single CSS document! © 2009 Michael Rees Web Applications 3
  • 4. CSS - Introduction • Cascading style sheets improve page load time for your site as there is less data to transfer • Normally, a browser has to download all of your formatting code in each and every one of your pages on your site • With CSS, the style sheet is downloaded once and cached, and every page request-response cycle after the first page is shorter © 2009 Michael Rees Web Applications 4
  • 5. Cascading Style Sheets • CSS is a vendor-neutral standard defined by the W3C (World Wide Web Consortium) • CSS added to HTML 4.0 • CSS is an extension to HTML to give web site developers fine control over page content display • CSS offers much more control over content than HTML tags alone • CSS is supported by all major browsers • CSS uses common (electronic) publishing terminology © 2009 Michael Rees Web Applications 5
  • 6. CSS Style Sheet Types • External (Linked) style sheet: – Style rules stored in separate .css file – A single .css file can be linked to any number of pages – A single page can link to many external style sheets • Embedded (Internal) style sheet: – Stored in the <head> tag of the page – Enclosed in <style> … </style> tags – Affects only that page – Overrides external style sheet • Inline style: – Specified in style attribute in individual HTML tags – Applies only to that tag – Overrides external and embedded style sheets • All 3 types of style sheets can be cascaded (mixed) in a single page © 2009 Michael Rees Web Applications 6
  • 7. Cascading Order • What style will be used when there is more than one style specified for an HTML tag? • All the styles will ‘cascade’ into a new ‘virtual’ style sheet in the following priority order: 1. Inline style (inside an HTML tag) 2. Embedded style sheet (inside the <head> tag) 3. External style sheet(s); last sheet linked in page takes precedence 4. Browser default style sheet © 2009 Michael Rees Web Applications 7
  • 8. CSS Notation • CSS uses simple declarative syntax to specify a collection of style rules to control the layout and typography a page http://www.w3schools.com/css/ © 2009 Michael Rees Web Applications 8
  • 9. Style Rule Syntax • A CSS style rule is made up of two parts: Example rule: – Selector: the part of H1 { color: red } HTML in the page that CSS style modifies – Declaration: style setting Selector applied to selector, again Declaration in two parts: • property name H1 { color: red } • property value Name Value © 2009 Michael Rees Web Applications 9
  • 10. CSS Selectors • Single element type: • Multiple element types: • All element types: • Specific elements by id: © 2009 Michael Rees Web Applications 10
  • 11. Class Selector • Elements belonging to a style class: – Referencing a style class in HTML: • Elements of a certain type and class: © 2009 Michael Rees Web Applications 11
  • 12. Link Pseudo-Classes • a:link {color:#FF0000} /* unvisited link */ • a:visited {color:#00FF00} /* visited link */ • a:hover {color:#FF00FF} /* mouse over link */ • a:active {color:#0000FF} /* selected link */ © 2009 Michael Rees Web Applications 12
  • 13. CSS Colour • CSS measures colour in two ways, either by a colour name (like ‘blue’) or by numerical RGB specification: #99CCFF - hexadecimal for sky blue • http://www.w3schools.com/css/css_colors.asp © 2009 Michael Rees Web Applications 13
  • 14. Cascading Style Sheets • For inspiration, an essential visit: – CSS Zen Garden • Validate your CSS code with: – The W3C CSS Validation Service • Learn the basics of CSS with: – W3Schools, CSS Tutorial © 2009 Michael Rees Web Applications 14
  • 15. Resources • Read Chapter 3 of textbook © 2009 Michael Rees Web Applications 15