SlideShare une entreprise Scribd logo
1  sur  16
HTML Tutorial 3HTML Tutorial 3
Web Development & Design Foundations with XHTML
Cascading Style Sheets (CSS)
Overview ofOverview of
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
What is CSS?
CSS stands for Cascading Style Sheets
Styles define how to display HTML elements
External Style Sheets can save a lot of work
Styles are normally saved in external .css files. External
style sheets enable you to change the appearance and
layout of all the pages in a Web site, just by editing one
single file!
2
Methods of using Styles:Methods of using Styles:
 Styling can be added to HTML elements in 3 ways:
1. Inline - using a style attribute in HTML elements
2. Internal - using a <style> element in the HTML <head>
section
3. External - using one or more external CSS files
 The most common way to add styling, is to keep the
CSS syntax in separate CSS files.
CSS SyntaxCSS Syntax
CSS Syntax SampleCSS Syntax Sample
Configure a Web page to display blue text and yellow
background.
body { color: blue;
background-color: yellow; }
This could also be written using hexadecimal color
values as shown below.
body { color: #0000FF;
background-color: #FFFF00; }
5
Color ValuesColor Values
CSS colors are defined using a
hexadecimal (hex) notation for the
combination of Red, Green, and Blue
color values (RGB). The lowest value that
can be given to one of the light sources is
0 (hex 00). The highest value is 255 (hex
FF).
Hex values are written as 3 double digit
numbers, starting with a # sign.
Using Color on Web PagesUsing Color on Web Pages
7
Common FormattingCommon Formatting
CSS PropertiesCSS Properties
 See Table 3.1 Common CSS Properties, including:
◦ background-color
◦ color
◦ font-family
◦ font-size
◦ font-style
◦ font-weight
◦ line-height
◦ margin
◦ text-align
◦ width
8
Configuring Text with CSSConfiguring Text with CSS
CSS properties for configuring text:
◦ font-weight
 Configures the boldness of text
◦ font-style
 Configures text to an italic style
◦ font-size
 Configures the size of the text
◦ font-family
 Configures the font typeface of the text
The font-family PropertyThe font-family Property
 Not everyone has the same fonts installed in their
computer
 Configure a list of fonts and include a generic family
name
p {font-family: Arial,Verdana, sans-
serif;}
1. External Style Sheets1. External Style Sheets
CSS style rules are contained in a
text file separate from the XHTML
documents.
The External Style Sheet text file:
◦ extension ".css"
◦ contains only style rules
◦ does not contain any XHTML tags
11
1.External Style Sheets -1.External Style Sheets - cont.cont.
◦ Multiple web pages can associate with the same external style sheet
file.
◦ Each page must include a link to the style sheet with the <link> tag. The
<link> tag goes inside the head section:
12
mystyle.css
index.htmindex.htm
clients.htmclients.htm
about.htmabout.htm
Etc…
2. Internal Style Sheet2. Internal Style Sheet
An internal style sheet should be used
when a single document has a unique
style.
You define internal styles in the head
section of an HTML page, inside the
<style> tag, like this:
Example:
Multiple Style SheetsMultiple Style Sheets
 If some properties have been set for the same selector
in different style sheets, the values will be inherited
from the more specific style sheet. 
 For example, assume that an external style sheet has the
following properties for the h1 selector:
 then, assume that an internal style sheet also has the following
property for the h1 selector:
 The left margin is inherited from the external style sheet and the
color is replaced by the internal style sheet.
3. Inline Styles3. Inline Styles
To use inline styles, add the style attribute to the
relevant tag. The example shows how to change
the color and the left margin of a h1 element:
An inline style loses many of the advantages of a
style sheet (by mixing content with
presentation). Use this method sparingly!
ReferenceReference
http://www.w3schools.com/html/html_cs
s.asp
Visit @ www.casestudyhelp.com
Or
Email id: casestudyassignmenthelp@gmail.com

Contenu connexe

Tendances

Tendances (20)

Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Css
CssCss
Css
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Css Basics
Css BasicsCss Basics
Css Basics
 
CSS
CSSCSS
CSS
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
css.ppt
css.pptcss.ppt
css.ppt
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
HTML5
HTML5HTML5
HTML5
 
Css
CssCss
Css
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Html n CSS
Html n CSSHtml n CSS
Html n CSS
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
CSS
CSSCSS
CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 

En vedette

CSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionCSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - Introduction
Mukesh Tekwani
 

En vedette (20)

The Joshua Tree Epiphany
The Joshua Tree EpiphanyThe Joshua Tree Epiphany
The Joshua Tree Epiphany
 
Chapter 1 - Web Design
Chapter 1 - Web DesignChapter 1 - Web Design
Chapter 1 - Web Design
 
Css(cascading style sheets)
Css(cascading style sheets)Css(cascading style sheets)
Css(cascading style sheets)
 
Curso de cascading style sheets (css)
Curso de cascading style sheets (css)Curso de cascading style sheets (css)
Curso de cascading style sheets (css)
 
Cascading Style Sheets (CSS) - An introduction
Cascading Style Sheets (CSS) - An introductionCascading Style Sheets (CSS) - An introduction
Cascading Style Sheets (CSS) - An introduction
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
 
Your Presentation is CRAP, and That's Why I Like It
Your Presentation is CRAP, and That's Why I Like ItYour Presentation is CRAP, and That's Why I Like It
Your Presentation is CRAP, and That's Why I Like It
 
Principles Of Effective Design
Principles Of Effective DesignPrinciples Of Effective Design
Principles Of Effective Design
 
A Guide to Using Color Effectively
A Guide to Using Color EffectivelyA Guide to Using Color Effectively
A Guide to Using Color Effectively
 
Basic css-tutorial
Basic css-tutorialBasic css-tutorial
Basic css-tutorial
 
CARP Design Principles
CARP Design PrinciplesCARP Design Principles
CARP Design Principles
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
 
Crap design
Crap designCrap design
Crap design
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Graphic and Web Design Principles
Graphic and Web Design PrinciplesGraphic and Web Design Principles
Graphic and Web Design Principles
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
CSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - IntroductionCSS-Cascading Style Sheets - Introduction
CSS-Cascading Style Sheets - Introduction
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 

Similaire à Cascading Style Sheets (CSS) help

Css introduction
Css introductionCss introduction
Css introduction
Sridhar P
 
Using Cascading Style Sheets2
Using Cascading Style Sheets2Using Cascading Style Sheets2
Using Cascading Style Sheets2
Sutinder Mann
 
Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10
Sutinder Mann
 
Lecture 3CSS part 1.pptx
Lecture 3CSS part 1.pptxLecture 3CSS part 1.pptx
Lecture 3CSS part 1.pptx
GmachImen
 

Similaire à Cascading Style Sheets (CSS) help (20)

Css introduction
Css introductionCss introduction
Css introduction
 
Tm 1st quarter - 3rd meeting
Tm   1st quarter - 3rd meetingTm   1st quarter - 3rd meeting
Tm 1st quarter - 3rd meeting
 
chitra
chitrachitra
chitra
 
Using Cascading Style Sheets2
Using Cascading Style Sheets2Using Cascading Style Sheets2
Using Cascading Style Sheets2
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
CSS - LinkedIn
CSS - LinkedInCSS - LinkedIn
CSS - LinkedIn
 
Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
Web technology Unit-II Part-C
Web technology Unit-II Part-CWeb technology Unit-II Part-C
Web technology Unit-II Part-C
 
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
 
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
 
Css
CssCss
Css
 
Lecture 3CSS part 1.pptx
Lecture 3CSS part 1.pptxLecture 3CSS part 1.pptx
Lecture 3CSS part 1.pptx
 
HTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxHTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptx
 
Lecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType ClassificationLecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType Classification
 
Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
CSS.ppt
CSS.pptCSS.ppt
CSS.ppt
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Css starting
Css startingCss starting
Css starting
 

Dernier

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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
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
 

Dernier (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
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
 
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
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
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
 
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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
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...
 
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
 
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
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

Cascading Style Sheets (CSS) help

  • 1. HTML Tutorial 3HTML Tutorial 3 Web Development & Design Foundations with XHTML Cascading Style Sheets (CSS)
  • 2. Overview ofOverview of Cascading Style Sheets (CSS)Cascading Style Sheets (CSS) What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements External Style Sheets can save a lot of work Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file! 2
  • 3. Methods of using Styles:Methods of using Styles:  Styling can be added to HTML elements in 3 ways: 1. Inline - using a style attribute in HTML elements 2. Internal - using a <style> element in the HTML <head> section 3. External - using one or more external CSS files  The most common way to add styling, is to keep the CSS syntax in separate CSS files.
  • 5. CSS Syntax SampleCSS Syntax Sample Configure a Web page to display blue text and yellow background. body { color: blue; background-color: yellow; } This could also be written using hexadecimal color values as shown below. body { color: #0000FF; background-color: #FFFF00; } 5
  • 6. Color ValuesColor Values CSS colors are defined using a hexadecimal (hex) notation for the combination of Red, Green, and Blue color values (RGB). The lowest value that can be given to one of the light sources is 0 (hex 00). The highest value is 255 (hex FF). Hex values are written as 3 double digit numbers, starting with a # sign.
  • 7. Using Color on Web PagesUsing Color on Web Pages 7
  • 8. Common FormattingCommon Formatting CSS PropertiesCSS Properties  See Table 3.1 Common CSS Properties, including: ◦ background-color ◦ color ◦ font-family ◦ font-size ◦ font-style ◦ font-weight ◦ line-height ◦ margin ◦ text-align ◦ width 8
  • 9. Configuring Text with CSSConfiguring Text with CSS CSS properties for configuring text: ◦ font-weight  Configures the boldness of text ◦ font-style  Configures text to an italic style ◦ font-size  Configures the size of the text ◦ font-family  Configures the font typeface of the text
  • 10. The font-family PropertyThe font-family Property  Not everyone has the same fonts installed in their computer  Configure a list of fonts and include a generic family name p {font-family: Arial,Verdana, sans- serif;}
  • 11. 1. External Style Sheets1. External Style Sheets CSS style rules are contained in a text file separate from the XHTML documents. The External Style Sheet text file: ◦ extension ".css" ◦ contains only style rules ◦ does not contain any XHTML tags 11
  • 12. 1.External Style Sheets -1.External Style Sheets - cont.cont. ◦ Multiple web pages can associate with the same external style sheet file. ◦ Each page must include a link to the style sheet with the <link> tag. The <link> tag goes inside the head section: 12 mystyle.css index.htmindex.htm clients.htmclients.htm about.htmabout.htm Etc…
  • 13. 2. Internal Style Sheet2. Internal Style Sheet An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, inside the <style> tag, like this: Example:
  • 14. Multiple Style SheetsMultiple Style Sheets  If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.   For example, assume that an external style sheet has the following properties for the h1 selector:  then, assume that an internal style sheet also has the following property for the h1 selector:  The left margin is inherited from the external style sheet and the color is replaced by the internal style sheet.
  • 15. 3. Inline Styles3. Inline Styles To use inline styles, add the style attribute to the relevant tag. The example shows how to change the color and the left margin of a h1 element: An inline style loses many of the advantages of a style sheet (by mixing content with presentation). Use this method sparingly!