SlideShare uma empresa Scribd logo
1 de 10
WEEK 11 REVIEW 
CSS 
(CASCADING 
STYLE SHEETS)
HTML IS THE FOUNDATION, 
CSS IS THE PRESENTATION
REVIEW: 
WHAT IS CSS? 
• CSS (Cascading Style Sheets) is a style sheet language developed to 
control the presentation (look and feel) of markup language documents, in 
our case HTML 
• CSS is a collection of formatting rules 
Examples: 
• size of font 
• color of font 
• font family 
• margins, 
• border, 
• underline etc…
ANATOMY OF A CSS STYLE
ELEMENT SELECTORS: 
FOR REGULAR HTML TAGS 
• The element selector selects all tags with the specified element name 
• These are very broad and the styles given to them would apply to all 
• Elements selectors refer to regular HTML tags 
p { color: red; } 
h1 { color: yellow; } 
ul { color: red; } 
strong { color: blue; } 
em { color: green; }
CLASS SELECTORS: 
FOR ANY ELEMENT 
• Classes can be added to any html element (<p>, <h1>, <strong>, 
<em>, etc.) 
• Classes can be named almost anything – you decide 
• You can apply a class as many times on a page as needed 
• Class selectors always start with a period in the css file (.example) 
CSS: 
.subhead { color: red; } 
HTML: 
<h2 class=”subhead”>My Subhead</h2>
ID SELECTORS: 
FOR ANY ONE ELEMENT ON A PAGE 
• An id selector needs to be unique within a page 
• Use the id selector when you want to style a single, unique 
element. 
CSS: 
#subhead { color: red; } 
HTML: 
<h2 id=”subhead”>My Subhead</h2>
3 WAYS TO APPLY STYLES 
1. Embedded style: 
• Typed directly into each html document, applies only to that document, 
embedded in the <head></head> section 
2. Linked style sheet 
• Separate style sheet document linked to each html page 
• Control the style of an entire site from 1 style sheet 
• Links go in the <head></head> section of each page 
3. In-line 
• Add the style attribute to the relevant tag, eg: <body style=“color: 
#333333”> 
• An inline style loses many of the advantages of a style sheet (by mixing 
content with presentation). Use this method sparingly!
LINKING CSS STYLE SHEETS 
• Linking a style sheet means that you can control the 
presentation of a site consisting of multiple pages from 1 CSS 
file 
You link to a separate file: 
• <link href="global.css" rel="stylesheet" type="text/css" /> 
• Linked Style Sheet are named with a .css extention (ie. 
global.css). 
• Linked Style Sheet are added in head section between the 
opening and closing head tags just like embedded CSS styles 
This is the technique we will be using in class
CSS: WHAT TO REMEMBER! 
• Start an element selector 
(an HTML tag) with just the tag, 
eg: 
body or p or h1 { declarations } 
• Start a class selector (a style 
you’ve created) with a period, 
eg: 
• Following the selector insert “curly” 
brackets that enclose all the 
declarations, eg: 
• Write the property: first followed by 
a the value; 
.className 
font-weight: normal;

Mais conteúdo relacionado

Mais procurados

New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3
Jamshid Hashimi
 

Mais procurados (20)

Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
Css Basics
Css BasicsCss Basics
Css Basics
 
Java script
Java scriptJava script
Java script
 
CSS
CSSCSS
CSS
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Css3
Css3Css3
Css3
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
HTML5 Tutorial
HTML5 TutorialHTML5 Tutorial
HTML5 Tutorial
 
New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Advanced Cascading Style Sheets
Advanced Cascading Style SheetsAdvanced Cascading Style Sheets
Advanced Cascading Style Sheets
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Css position
Css positionCss position
Css position
 
introduction to CSS
introduction to CSSintroduction to CSS
introduction to CSS
 
HTML CSS JS in Nut shell
HTML  CSS JS in Nut shellHTML  CSS JS in Nut shell
HTML CSS JS in Nut shell
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 

Destaque

Destaque (19)

Css
CssCss
Css
 
Casc Style Sheets Ii
Casc Style Sheets IiCasc Style Sheets Ii
Casc Style Sheets Ii
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Css from scratch
Css from scratchCss from scratch
Css from scratch
 
JDBC
JDBCJDBC
JDBC
 
Pseudo CSS Selectors
Pseudo CSS SelectorsPseudo CSS Selectors
Pseudo CSS Selectors
 
CSS Pseudo Classes
CSS Pseudo ClassesCSS Pseudo Classes
CSS Pseudo Classes
 
Css selectors
Css selectorsCss selectors
Css selectors
 
Css pseudo-classes
Css pseudo-classesCss pseudo-classes
Css pseudo-classes
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database Connectivity
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Agile Development | Agile Process Models
Agile Development | Agile Process ModelsAgile Development | Agile Process Models
Agile Development | Agile Process Models
 
Jdbc Ppt
Jdbc PptJdbc Ppt
Jdbc Ppt
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 

Semelhante a Week 12 CSS - Review from last week

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
alvindalejoyosa1
 
Css introduction
Css introductionCss introduction
Css introduction
Sridhar P
 

Semelhante a Week 12 CSS - Review from last week (20)

Week11 Lecture: CSS
Week11 Lecture: CSSWeek11 Lecture: CSS
Week11 Lecture: CSS
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
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
CssCss
Css
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Css
CssCss
Css
 
Css introduction
Css introductionCss introduction
Css introduction
 
DHTML
DHTMLDHTML
DHTML
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
Css
CssCss
Css
 
CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)
 
Css
CssCss
Css
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-14. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1
 
CSS Training in Bangalore
CSS Training in BangaloreCSS Training in Bangalore
CSS Training in Bangalore
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
 
Css
CssCss
Css
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
 

Mais de Katherine McCurdy-Lapierre, R.G.D.

Mais de Katherine McCurdy-Lapierre, R.G.D. (18)

Module 5 - WCM system comparison
Module 5 - WCM system comparison Module 5 - WCM system comparison
Module 5 - WCM system comparison
 
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
 
Module 3 - Intro to Bootstrap
Module 3 - Intro to BootstrapModule 3 - Intro to Bootstrap
Module 3 - Intro to Bootstrap
 
Week 4 - tablet app design
Week 4 - tablet app designWeek 4 - tablet app design
Week 4 - tablet app design
 
Week 3 Lecture: Accessibility
Week 3 Lecture: AccessibilityWeek 3 Lecture: Accessibility
Week 3 Lecture: Accessibility
 
Interactive Web Design 5 - Week 2 - Introduction
Interactive Web Design 5 - Week 2 -  IntroductionInteractive Web Design 5 - Week 2 -  Introduction
Interactive Web Design 5 - Week 2 - Introduction
 
Week 12 CSS Font - size
Week 12 CSS Font - sizeWeek 12 CSS Font - size
Week 12 CSS Font - size
 
Week 12 CSS Font - family
Week 12 CSS Font - familyWeek 12 CSS Font - family
Week 12 CSS Font - family
 
Week 6 Lecture
Week 6 LectureWeek 6 Lecture
Week 6 Lecture
 
Week 5 Lecture
Week 5 LectureWeek 5 Lecture
Week 5 Lecture
 
Week 4 Lecture Accessibility
Week 4 Lecture AccessibilityWeek 4 Lecture Accessibility
Week 4 Lecture Accessibility
 
Week 4 Lecture Part 1
Week 4 Lecture Part 1Week 4 Lecture Part 1
Week 4 Lecture Part 1
 
Week 4 Lecture Part 2
Week 4 Lecture Part 2Week 4 Lecture Part 2
Week 4 Lecture Part 2
 
Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1
 
Artistic Web Applications - Week3 - Part 3
Artistic Web Applications - Week3 - Part 3Artistic Web Applications - Week3 - Part 3
Artistic Web Applications - Week3 - Part 3
 
Artistic Web Applications - Week3 - Part 2
Artistic Web Applications - Week3 - Part 2Artistic Web Applications - Week3 - Part 2
Artistic Web Applications - Week3 - Part 2
 
Week2 lecture-whatiswebdesign-part1
Week2 lecture-whatiswebdesign-part1Week2 lecture-whatiswebdesign-part1
Week2 lecture-whatiswebdesign-part1
 
LecWeek2 lecture-whatiswebdesign-part2
LecWeek2 lecture-whatiswebdesign-part2LecWeek2 lecture-whatiswebdesign-part2
LecWeek2 lecture-whatiswebdesign-part2
 

Último

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
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Último (20)

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
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
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
 
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 ...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Week 12 CSS - Review from last week

  • 1. WEEK 11 REVIEW CSS (CASCADING STYLE SHEETS)
  • 2. HTML IS THE FOUNDATION, CSS IS THE PRESENTATION
  • 3. REVIEW: WHAT IS CSS? • CSS (Cascading Style Sheets) is a style sheet language developed to control the presentation (look and feel) of markup language documents, in our case HTML • CSS is a collection of formatting rules Examples: • size of font • color of font • font family • margins, • border, • underline etc…
  • 4. ANATOMY OF A CSS STYLE
  • 5. ELEMENT SELECTORS: FOR REGULAR HTML TAGS • The element selector selects all tags with the specified element name • These are very broad and the styles given to them would apply to all • Elements selectors refer to regular HTML tags p { color: red; } h1 { color: yellow; } ul { color: red; } strong { color: blue; } em { color: green; }
  • 6. CLASS SELECTORS: FOR ANY ELEMENT • Classes can be added to any html element (<p>, <h1>, <strong>, <em>, etc.) • Classes can be named almost anything – you decide • You can apply a class as many times on a page as needed • Class selectors always start with a period in the css file (.example) CSS: .subhead { color: red; } HTML: <h2 class=”subhead”>My Subhead</h2>
  • 7. ID SELECTORS: FOR ANY ONE ELEMENT ON A PAGE • An id selector needs to be unique within a page • Use the id selector when you want to style a single, unique element. CSS: #subhead { color: red; } HTML: <h2 id=”subhead”>My Subhead</h2>
  • 8. 3 WAYS TO APPLY STYLES 1. Embedded style: • Typed directly into each html document, applies only to that document, embedded in the <head></head> section 2. Linked style sheet • Separate style sheet document linked to each html page • Control the style of an entire site from 1 style sheet • Links go in the <head></head> section of each page 3. In-line • Add the style attribute to the relevant tag, eg: <body style=“color: #333333”> • An inline style loses many of the advantages of a style sheet (by mixing content with presentation). Use this method sparingly!
  • 9. LINKING CSS STYLE SHEETS • Linking a style sheet means that you can control the presentation of a site consisting of multiple pages from 1 CSS file You link to a separate file: • <link href="global.css" rel="stylesheet" type="text/css" /> • Linked Style Sheet are named with a .css extention (ie. global.css). • Linked Style Sheet are added in head section between the opening and closing head tags just like embedded CSS styles This is the technique we will be using in class
  • 10. CSS: WHAT TO REMEMBER! • Start an element selector (an HTML tag) with just the tag, eg: body or p or h1 { declarations } • Start a class selector (a style you’ve created) with a period, eg: • Following the selector insert “curly” brackets that enclose all the declarations, eg: • Write the property: first followed by a the value; .className font-weight: normal;