SlideShare a Scribd company logo
Cascading Style Sheets
Plan of the course What is CSS CSS levels Including CSS in HTML files CSS syntax Colours in HTML Examples
CSS CSS = Cascading Style-Sheets Style = how the HTML tags are displayed Style-sheets = documents where the style information is stored – usually external documents Cascading = there are multiple levels on which we can define the style of a page
CSS usage The style information can be attached in the HTML page to each element => problems in maintaining the page => problems in large sites containing many pages Much easier if the style for all the elements is stored separately – modifications made in 1 place are spread to all the pages automatically
CSS levels Style information can be defined at multiple levels Browser level  – the default style of the browser The way the page is displayed if no style information is present
CSS Browser level example Default browser style; no style specified in html After we modified the default browser style
CSS levels External document level  – the style is specified in an external .css file. The file is included in the html document by using the link element <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=“style.css&quot; />
CSS External Document Level h1 { color: blue;}
CSS levels Internal style sheet (inside the <head> tag)  Define the style-sheet inside the html page Style specified inside a style element Example: <style type=&quot;text/css&quot;> h1 {color: yellow} </style>
CSS Internal Style Sheet Level  <head> <title>le titre du document</title> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; /> <style type=&quot;text/css&quot;> h1 {color: yellow} </style> </head>
CSS Levels Element level – the style is specified inside the element  NOT RECOMMENDED!!! Example <h1 style=&quot;color: black;&quot; > Introduction dans la programmation web</h1>
CSS Element Style Level <h1 style=&quot;color: black;&quot; > Introduction dans la programmation web</h1>
CSS Levels - Conclusion Browser level  Not reliable (dependant on browser) External document level The one we’ll be using Internal style sheet (inside the head tag) Should not be used Element style level Should NEVER be used Priority increases
CSS Syntax Syntax contains triples: Selector – on what element(s) we’re applying the style Property – which is the property that we change Value – the modified value h1  { color :  yellow; }
CSS syntax – selector types A selector can be the name of an html element (h1) The style defined applies for all elements of that type The name of an element “.”the name of the style class H1.blue{color:blue;} The class is used inside the html element as an attribute <h1 class=“blue”> The id of an element #id5 {color:blue;} In the html the element must have the id defined <h1 id=“id5”>
Colours in html/css Colours are identified through Names (blue, red, green,…) This is possible for a very small number of colours Values A colour is represented as a triplet of RGB values Each value in the triplet can take a value between 0-255 (FF in hexa) The total number of colours that can be expressed like this is around 16 million A colour value is formed like #RRGGBB where RR=the hexa value for red, GG=hexa value for green…
Colours in html examples Black #000000 White #FFFFFF Red  #FF0000 Green  #00FF00 Blue  #0000FF Yellow  # FFFF00
CSS Examples body { background-image: url('bgdesert.jpg') }  body { background-color: #FFFF00; }
Text properties
list properties
padding properties margin properties
CSS Tables Example table, td, th { border:1px solid green; //border-collapse:collapse; } th { background-color:green; color:white; } Without border-collapse With border-collapse
CSS HowTO There are a lot of CSS values and attributes to set the style Difficult to know them all Need to use a internet reference like http://www.w3schools.com/css/css_reference.asp Need to understand the mechanisms of CSS Use the reference to discover more hidden html design features!
Conclusions CSS = the way to modify the style of a html page 4 levels of priority - use as much as possible external stylesheets Remember that style and semantics are different things for an HTML page

More Related Content

What's hot (19)

PPTX
html-css
Dhirendra Chauhan
 
PPTX
Html, CSS & Web Designing
Leslie Steele
 
PPTX
Introduction to html course digital markerters
SEO SKills
 
ODP
Introduction of Html/css/js
Knoldus Inc.
 
PPT
Introduction to Cascading Style Sheets
Tushar Joshi
 
ODP
Cascading Style Sheets - Part 01
Hatem Mahmoud
 
PDF
3 Layers of the Web - Part 1
Jeremy White
 
PPTX
Html
Noha Sayed
 
PDF
CSS notes
Rajendra Prasad
 
PDF
Intro to HTML and CSS - Class 2 Slides
Heather Rock
 
PDF
CSS Refresher
Gerson Abesamis
 
PPTX
Html
NithyaD5
 
PPTX
Css
Hemant Saini
 
PPT
Advanced Cascading Style Sheets
fantasticdigitaltools
 
PDF
1. HTML
Pavle Đorđević
 
PPT
CSS ppt
Sanmuga Nathan
 
ODP
An Introduction to Cascading Style Sheets (CSS3)
Ardee Aram
 
PPT
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
Html, CSS & Web Designing
Leslie Steele
 
Introduction to html course digital markerters
SEO SKills
 
Introduction of Html/css/js
Knoldus Inc.
 
Introduction to Cascading Style Sheets
Tushar Joshi
 
Cascading Style Sheets - Part 01
Hatem Mahmoud
 
3 Layers of the Web - Part 1
Jeremy White
 
CSS notes
Rajendra Prasad
 
Intro to HTML and CSS - Class 2 Slides
Heather Rock
 
CSS Refresher
Gerson Abesamis
 
Html
NithyaD5
 
Advanced Cascading Style Sheets
fantasticdigitaltools
 
An Introduction to Cascading Style Sheets (CSS3)
Ardee Aram
 
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 

Viewers also liked (20)

PPT
Introduction to Web Programming - first course
Vlad Posea
 
PDF
Introduction to Web Programming
Ynon Perek
 
PDF
Web Programming Intro
Ynon Perek
 
PPTX
Programarea calculatoarelor c2
Vlad Posea
 
PPT
C5 Javascript
Vlad Posea
 
PPTX
IPW 2eme course - HTML
Vlad Posea
 
PPT
C5 Javascript French
Vlad Posea
 
PPT
Usability and accessibility on the web
Vlad Posea
 
PPTX
Ce mă fac când o să fiu mare - optiuni pentru o cariera in IT
Vlad Posea
 
PPTX
Linked Open Data in Romania
Vlad Posea
 
PPT
C5 Javascript
Vlad Posea
 
PPT
Introduction dans la Programmation Web Course 1
Vlad Posea
 
PPT
utilisabilite et accessibilite au web
Vlad Posea
 
PPT
HTML 5 - intro - en francais
Vlad Posea
 
PPT
IPW Course 3 CSS
Vlad Posea
 
PPTX
Css+html
Vlad Posea
 
PPT
Présentation html5
Kénium
 
PDF
Cours HTML/CSS
Axel Chalon
 
PDF
Sample Website Proposal Presentation
Reach China Holdings Limited
 
PDF
Beautiful CSS : Structurer, documenter, maintenir
Yves Van Goethem
 
Introduction to Web Programming - first course
Vlad Posea
 
Introduction to Web Programming
Ynon Perek
 
Web Programming Intro
Ynon Perek
 
Programarea calculatoarelor c2
Vlad Posea
 
C5 Javascript
Vlad Posea
 
IPW 2eme course - HTML
Vlad Posea
 
C5 Javascript French
Vlad Posea
 
Usability and accessibility on the web
Vlad Posea
 
Ce mă fac când o să fiu mare - optiuni pentru o cariera in IT
Vlad Posea
 
Linked Open Data in Romania
Vlad Posea
 
C5 Javascript
Vlad Posea
 
Introduction dans la Programmation Web Course 1
Vlad Posea
 
utilisabilite et accessibilite au web
Vlad Posea
 
HTML 5 - intro - en francais
Vlad Posea
 
IPW Course 3 CSS
Vlad Posea
 
Css+html
Vlad Posea
 
Présentation html5
Kénium
 
Cours HTML/CSS
Axel Chalon
 
Sample Website Proposal Presentation
Reach China Holdings Limited
 
Beautiful CSS : Structurer, documenter, maintenir
Yves Van Goethem
 
Ad

Similar to IPW 3rd Course - CSS (20)

PDF
cascading style sheets ppt.sildeshower phone view
kedaringle994
 
PPTX
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
300179
 
PPTX
cascading style sheet(css).pptx
SuhaibKhan62
 
PPTX
CSS Basics (Cascading Style Sheet)
Ajay Khatri
 
PPT
Introduction to css by programmerblog.net
Programmer Blog
 
PPT
Cascading Style Sheets (CSS) help
casestudyhelp
 
PDF
Css tutorial
vedaste
 
PPTX
BITM3730Week4.pptx
MattMarino13
 
PPTX
CSS.pptx
PushpaLatha551681
 
PPTX
CSS____4563276__HTML___________0989.pptx
Ajanya5
 
PPTX
Cascading style sheet an introduction
Himanshu Pathak
 
PPTX
4_css_intro.pptx. this ppt is based on css which is the required of web deve...
sindwanigripsi
 
PPSX
Introduction to css
Evolution Network
 
PPTX
Kick start @ css
Umesh Agarwal
 
PPT
Css present
MissaGiles
 
PPT
ch04-css-basics_final.ppt
GmachImen
 
cascading style sheets ppt.sildeshower phone view
kedaringle994
 
HTML-CSS-QUARTER4 COMPUTER PROGRAMMING SSC
300179
 
cascading style sheet(css).pptx
SuhaibKhan62
 
CSS Basics (Cascading Style Sheet)
Ajay Khatri
 
Introduction to css by programmerblog.net
Programmer Blog
 
Cascading Style Sheets (CSS) help
casestudyhelp
 
Css tutorial
vedaste
 
BITM3730Week4.pptx
MattMarino13
 
CSS____4563276__HTML___________0989.pptx
Ajanya5
 
Cascading style sheet an introduction
Himanshu Pathak
 
4_css_intro.pptx. this ppt is based on css which is the required of web deve...
sindwanigripsi
 
Introduction to css
Evolution Network
 
Kick start @ css
Umesh Agarwal
 
Css present
MissaGiles
 
ch04-css-basics_final.ppt
GmachImen
 
Ad

More from Vlad Posea (14)

PPTX
Design thinking
Vlad Posea
 
PPTX
Talentul meu – mersul pe bicicletă
Vlad Posea
 
PPTX
Programarea calculatoarelor - Limbajul C
Vlad Posea
 
PPTX
Social semantic web
Vlad Posea
 
PDF
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012
Vlad Posea
 
PDF
Json tutorial
Vlad Posea
 
PDF
Javascript ajax tutorial
Vlad Posea
 
PPT
Studiu Referitor La Insertia Pe Piata Muncii (1)
Vlad Posea
 
PPT
Aplicații Web Semantice - Descriere Proiect
Vlad Posea
 
PPT
Stagii In Strainatate
Vlad Posea
 
PPT
Student si/sau Angajat
Vlad Posea
 
PDF
Ghidul bobocului de la Facultatea de Automatica si Calculatoare
Vlad Posea
 
PPT
Tips & Tricks Proiect
Vlad Posea
 
PPT
Boboc Advisory Board Intalnire 1
Vlad Posea
 
Design thinking
Vlad Posea
 
Talentul meu – mersul pe bicicletă
Vlad Posea
 
Programarea calculatoarelor - Limbajul C
Vlad Posea
 
Social semantic web
Vlad Posea
 
Ghidul Bobocului de la Facultatea de Automatica si Calculatoare vers 2011-2012
Vlad Posea
 
Json tutorial
Vlad Posea
 
Javascript ajax tutorial
Vlad Posea
 
Studiu Referitor La Insertia Pe Piata Muncii (1)
Vlad Posea
 
Aplicații Web Semantice - Descriere Proiect
Vlad Posea
 
Stagii In Strainatate
Vlad Posea
 
Student si/sau Angajat
Vlad Posea
 
Ghidul bobocului de la Facultatea de Automatica si Calculatoare
Vlad Posea
 
Tips & Tricks Proiect
Vlad Posea
 
Boboc Advisory Board Intalnire 1
Vlad Posea
 

Recently uploaded (20)

PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 

IPW 3rd Course - CSS

  • 2. Plan of the course What is CSS CSS levels Including CSS in HTML files CSS syntax Colours in HTML Examples
  • 3. CSS CSS = Cascading Style-Sheets Style = how the HTML tags are displayed Style-sheets = documents where the style information is stored – usually external documents Cascading = there are multiple levels on which we can define the style of a page
  • 4. CSS usage The style information can be attached in the HTML page to each element => problems in maintaining the page => problems in large sites containing many pages Much easier if the style for all the elements is stored separately – modifications made in 1 place are spread to all the pages automatically
  • 5. CSS levels Style information can be defined at multiple levels Browser level – the default style of the browser The way the page is displayed if no style information is present
  • 6. CSS Browser level example Default browser style; no style specified in html After we modified the default browser style
  • 7. CSS levels External document level – the style is specified in an external .css file. The file is included in the html document by using the link element <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=“style.css&quot; />
  • 8. CSS External Document Level h1 { color: blue;}
  • 9. CSS levels Internal style sheet (inside the <head> tag) Define the style-sheet inside the html page Style specified inside a style element Example: <style type=&quot;text/css&quot;> h1 {color: yellow} </style>
  • 10. CSS Internal Style Sheet Level <head> <title>le titre du document</title> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; /> <style type=&quot;text/css&quot;> h1 {color: yellow} </style> </head>
  • 11. CSS Levels Element level – the style is specified inside the element NOT RECOMMENDED!!! Example <h1 style=&quot;color: black;&quot; > Introduction dans la programmation web</h1>
  • 12. CSS Element Style Level <h1 style=&quot;color: black;&quot; > Introduction dans la programmation web</h1>
  • 13. CSS Levels - Conclusion Browser level Not reliable (dependant on browser) External document level The one we’ll be using Internal style sheet (inside the head tag) Should not be used Element style level Should NEVER be used Priority increases
  • 14. CSS Syntax Syntax contains triples: Selector – on what element(s) we’re applying the style Property – which is the property that we change Value – the modified value h1 { color : yellow; }
  • 15. CSS syntax – selector types A selector can be the name of an html element (h1) The style defined applies for all elements of that type The name of an element “.”the name of the style class H1.blue{color:blue;} The class is used inside the html element as an attribute <h1 class=“blue”> The id of an element #id5 {color:blue;} In the html the element must have the id defined <h1 id=“id5”>
  • 16. Colours in html/css Colours are identified through Names (blue, red, green,…) This is possible for a very small number of colours Values A colour is represented as a triplet of RGB values Each value in the triplet can take a value between 0-255 (FF in hexa) The total number of colours that can be expressed like this is around 16 million A colour value is formed like #RRGGBB where RR=the hexa value for red, GG=hexa value for green…
  • 17. Colours in html examples Black #000000 White #FFFFFF Red #FF0000 Green #00FF00 Blue #0000FF Yellow # FFFF00
  • 18. CSS Examples body { background-image: url('bgdesert.jpg') } body { background-color: #FFFF00; }
  • 22. CSS Tables Example table, td, th { border:1px solid green; //border-collapse:collapse; } th { background-color:green; color:white; } Without border-collapse With border-collapse
  • 23. CSS HowTO There are a lot of CSS values and attributes to set the style Difficult to know them all Need to use a internet reference like http://www.w3schools.com/css/css_reference.asp Need to understand the mechanisms of CSS Use the reference to discover more hidden html design features!
  • 24. Conclusions CSS = the way to modify the style of a html page 4 levels of priority - use as much as possible external stylesheets Remember that style and semantics are different things for an HTML page