SlideShare a Scribd company logo
1 of 25
CSS Introduction
Cascading Style Sheet is a feature being
added to HTML that gives both Web site
developers and users more control over
how pages are displayed. With CSS,
designers and users can create style
sheets that define how different elements,
such as headers and links, appear. These
style sheets can then be applied to any
Web page.
The term cascading derives from the fact
that multiple style sheets can be applied to
the same Web page.
Use of StyleSheets
separate structure from appearance
create consistent appearance
ease of maintenance
increase accessibility
apply additional effects
reduce use of non-standard tags
reduce web page file size
Consistent Appearance & Ease of
Maintenance
Create one style sheet
Use link tag to use
• for several web pages
Make changes in one file
Consistent Appearance & Ease of
Maintenance
Create one style sheet
Use link tag to use
• for several web pages
Make changes in one file
Increase Accessibility
User can override your style sheet
You can create different style sheets for
alternative devices
Apply Additional Effects
Add hover effect to links
Remove underlines on links
Add horizontal rule to headings
Use instead of a table for a border
Control paragraph, line, letter spacing
Use instead of tables for layout
Additional effects
h1 { font-size: 2em; vertical-align: text-bottom;
line-height: 1.25em; margin-right: 5%;
font-family: "Arial Black", Verdana, sans-serif;
letter-spacing: 0.5em;
color: blue; background-color: silver}
h2 { border-style: solid none none none;
border-width: medium; border-color: #808080;
margin-top: 1.5em; margin-bottom: .5em;
font-size: 1.75em; text-transform: capitalize; }
ul { margin-top: .1em; list-style: square}
li { margin-bottom: .25em;}
a { text-decoration: none; }
a:hover { text-decoration: underline;
color: #800000; background-color: #ffcc00;}
Replace Non-standard Tags
Some tags and attributes have been
deprecated in HTML 4.0 Strict
<font face=arial color=red
size=+2>
<basefont …>
<center>
<h1 align=center>
<td valign=top height=45 >
<ul type=square>
Reduce Web PageFile Size
Every keystroke counts!
Smaller files load more quickly
Save disk space
Keep it in mind when usingCSS
Older browsers either dont understand
it, or understand it badly
(incompatibilities)
In some instances current browsers
sometimes interpret the style differently
thus resulting in different results.
Type of CSS
Inline stylesheet
<H1 style="color: maroon">
Embedded stylesheet
<style> </style>
External stylesheet
<link href="style.css">
Inline Stylesheet
<H1 style="color: maroon">
Similar to adding attributes to html
tags
Disadvantages
decreased accessibility
increased file size
harder to update
Embedded stylesheets
<style>
<!--
h1 {font-family: arial, sans-serif;}
-->
</style>
 Put rules between style tags
 Put in head section
 Add html comment tags
 Use when single document has unique style
External style sheets
<link rel="stylesheet"
type="text/css"
href="style.css">
Save rules in external file
Advantages
ease of maintenance
use less disk space
increase accessibility
Rules
A Cascading Style Sheets rule is
made up of a selector and a
declaration.
H2 {color: blue;}
selector {declaration;}
Declaration
The declaration is the part of the rule
inside the curly braces. It specifies what
a style effect will be.
For example, "color: blue".
CSS selectors
Selectors are one of the most important
aspects of CSS as they are used to
"select" elements on an HTML page so
that they can be styled.
Type selectors
Class selectors
ID selectors
Typeselectors
The most common and easy to
understand selectors are type selectors.
Type selectors will select any HTML
element on a page that matches the
selector, regardless of their position in
the document tree. For example:
h1 {color: blue; font-size:16;}
p {color: green; font-
size:12;}
Class selectors
While type selectors target every
instance of an element, class selectors
can be used to select any HTML
element that has a class attribute,
regardless of their position in the
document tree.
For example, if you want to target the first
paragraph and first list items on a page to make
them stand out, you could mark up the page in the
following way:
<body>
<p class="big">This is some
<em>text</em></p>
<p>This is some text</p>
<ul>
<li class="big">List item</li>
<li>List item</li>
<li>List <em>item</em></li>
</ul>
</body>
ID selectors
The most common and easy to
understand selectors are type selectors.
Type selectors will select any HTML
element on a page that matches the
selector, regardless of their position in
the document tree. For example:
h1 {color: blue; }
p {font-family-arial; text-
align: justify; }
Browser Support
Older (before CSS): NN3, Lynx
Broken: IE3, IE4, NN4
Compliant:
Mozilla and Netscape 6
Opera 5 and 6
recent versions of Internet Explorer
CSS andAccessibility
Use good HTML: <h1> insteadof
<div style="font-size: big; font-weight: bold;">
Make sure page is readable
without any style sheet enabled
Cascading style-sheet-

More Related Content

What's hot

What's hot (19)

Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Web topic 16 css workflow
Web topic 16  css workflowWeb topic 16  css workflow
Web topic 16 css workflow
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
What is CSS?
What is CSS?What is CSS?
What is CSS?
 
The three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth yearThe three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth year
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
Css
CssCss
Css
 
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
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Css
CssCss
Css
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
Css ms megha
Css ms meghaCss ms megha
Css ms megha
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
chitra
chitrachitra
chitra
 
Welcome to css!
Welcome to css!Welcome to css!
Welcome to css!
 
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 basic
Css basicCss basic
Css basic
 

Similar to Cascading style-sheet-

Similar to Cascading style-sheet- (20)

Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
Css
CssCss
Css
 
Css introduction
Css introductionCss introduction
Css introduction
 
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
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
Web technology Unit-II Part-C
Web technology Unit-II Part-CWeb technology Unit-II Part-C
Web technology Unit-II Part-C
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
 
Css 2010
Css 2010Css 2010
Css 2010
 
Css 2010
Css 2010Css 2010
Css 2010
 
A quick guide to Css and java script
A quick guide to Css and  java scriptA quick guide to Css and  java script
A quick guide to Css and java script
 
Css.html
Css.htmlCss.html
Css.html
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
 
Css
CssCss
Css
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.ppt
 
Css
CssCss
Css
 
Css
CssCss
Css
 

More from Nimrakhan89

Dbms lifecycle. ..Database System Development Lifecycle
Dbms lifecycle. ..Database System  Development LifecycleDbms lifecycle. ..Database System  Development Lifecycle
Dbms lifecycle. ..Database System Development LifecycleNimrakhan89
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Nimrakhan89
 
HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners Nimrakhan89
 
tables in html and there tags ....
tables in html and there tags ....tables in html and there tags ....
tables in html and there tags ....Nimrakhan89
 
Relational Database & Database Management System
Relational Database & Database Management SystemRelational Database & Database Management System
Relational Database & Database Management SystemNimrakhan89
 
network modeling ....and its advantages and disadvantages...
network modeling ....and its advantages and disadvantages...network modeling ....and its advantages and disadvantages...
network modeling ....and its advantages and disadvantages...Nimrakhan89
 
HTML language and all its tags .....
HTML language and all its tags .....HTML language and all its tags .....
HTML language and all its tags .....Nimrakhan89
 
threads and its types ....in operating system ..
threads and its types ....in operating system ..threads and its types ....in operating system ..
threads and its types ....in operating system ..Nimrakhan89
 
Communication skills
Communication skills Communication skills
Communication skills Nimrakhan89
 

More from Nimrakhan89 (9)

Dbms lifecycle. ..Database System Development Lifecycle
Dbms lifecycle. ..Database System  Development LifecycleDbms lifecycle. ..Database System  Development Lifecycle
Dbms lifecycle. ..Database System Development Lifecycle
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..
 
HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners
 
tables in html and there tags ....
tables in html and there tags ....tables in html and there tags ....
tables in html and there tags ....
 
Relational Database & Database Management System
Relational Database & Database Management SystemRelational Database & Database Management System
Relational Database & Database Management System
 
network modeling ....and its advantages and disadvantages...
network modeling ....and its advantages and disadvantages...network modeling ....and its advantages and disadvantages...
network modeling ....and its advantages and disadvantages...
 
HTML language and all its tags .....
HTML language and all its tags .....HTML language and all its tags .....
HTML language and all its tags .....
 
threads and its types ....in operating system ..
threads and its types ....in operating system ..threads and its types ....in operating system ..
threads and its types ....in operating system ..
 
Communication skills
Communication skills Communication skills
Communication skills
 

Recently uploaded

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
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
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
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
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
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
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...
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 

Cascading style-sheet-

  • 1.
  • 2. CSS Introduction Cascading Style Sheet is a feature being added to HTML that gives both Web site developers and users more control over how pages are displayed. With CSS, designers and users can create style sheets that define how different elements, such as headers and links, appear. These style sheets can then be applied to any Web page. The term cascading derives from the fact that multiple style sheets can be applied to the same Web page.
  • 3. Use of StyleSheets separate structure from appearance create consistent appearance ease of maintenance increase accessibility apply additional effects reduce use of non-standard tags reduce web page file size
  • 4. Consistent Appearance & Ease of Maintenance Create one style sheet Use link tag to use • for several web pages Make changes in one file
  • 5. Consistent Appearance & Ease of Maintenance Create one style sheet Use link tag to use • for several web pages Make changes in one file
  • 6. Increase Accessibility User can override your style sheet You can create different style sheets for alternative devices
  • 7. Apply Additional Effects Add hover effect to links Remove underlines on links Add horizontal rule to headings Use instead of a table for a border Control paragraph, line, letter spacing Use instead of tables for layout
  • 8. Additional effects h1 { font-size: 2em; vertical-align: text-bottom; line-height: 1.25em; margin-right: 5%; font-family: "Arial Black", Verdana, sans-serif; letter-spacing: 0.5em; color: blue; background-color: silver} h2 { border-style: solid none none none; border-width: medium; border-color: #808080; margin-top: 1.5em; margin-bottom: .5em; font-size: 1.75em; text-transform: capitalize; } ul { margin-top: .1em; list-style: square} li { margin-bottom: .25em;} a { text-decoration: none; } a:hover { text-decoration: underline; color: #800000; background-color: #ffcc00;}
  • 9. Replace Non-standard Tags Some tags and attributes have been deprecated in HTML 4.0 Strict <font face=arial color=red size=+2> <basefont …> <center> <h1 align=center> <td valign=top height=45 > <ul type=square>
  • 10. Reduce Web PageFile Size Every keystroke counts! Smaller files load more quickly Save disk space
  • 11. Keep it in mind when usingCSS Older browsers either dont understand it, or understand it badly (incompatibilities) In some instances current browsers sometimes interpret the style differently thus resulting in different results.
  • 12. Type of CSS Inline stylesheet <H1 style="color: maroon"> Embedded stylesheet <style> </style> External stylesheet <link href="style.css">
  • 13. Inline Stylesheet <H1 style="color: maroon"> Similar to adding attributes to html tags Disadvantages decreased accessibility increased file size harder to update
  • 14. Embedded stylesheets <style> <!-- h1 {font-family: arial, sans-serif;} --> </style>  Put rules between style tags  Put in head section  Add html comment tags  Use when single document has unique style
  • 15. External style sheets <link rel="stylesheet" type="text/css" href="style.css"> Save rules in external file Advantages ease of maintenance use less disk space increase accessibility
  • 16. Rules A Cascading Style Sheets rule is made up of a selector and a declaration. H2 {color: blue;} selector {declaration;}
  • 17. Declaration The declaration is the part of the rule inside the curly braces. It specifies what a style effect will be. For example, "color: blue".
  • 18. CSS selectors Selectors are one of the most important aspects of CSS as they are used to "select" elements on an HTML page so that they can be styled. Type selectors Class selectors ID selectors
  • 19. Typeselectors The most common and easy to understand selectors are type selectors. Type selectors will select any HTML element on a page that matches the selector, regardless of their position in the document tree. For example: h1 {color: blue; font-size:16;} p {color: green; font- size:12;}
  • 20. Class selectors While type selectors target every instance of an element, class selectors can be used to select any HTML element that has a class attribute, regardless of their position in the document tree. For example, if you want to target the first paragraph and first list items on a page to make them stand out, you could mark up the page in the following way:
  • 21. <body> <p class="big">This is some <em>text</em></p> <p>This is some text</p> <ul> <li class="big">List item</li> <li>List item</li> <li>List <em>item</em></li> </ul> </body>
  • 22. ID selectors The most common and easy to understand selectors are type selectors. Type selectors will select any HTML element on a page that matches the selector, regardless of their position in the document tree. For example: h1 {color: blue; } p {font-family-arial; text- align: justify; }
  • 23. Browser Support Older (before CSS): NN3, Lynx Broken: IE3, IE4, NN4 Compliant: Mozilla and Netscape 6 Opera 5 and 6 recent versions of Internet Explorer
  • 24. CSS andAccessibility Use good HTML: <h1> insteadof <div style="font-size: big; font-weight: bold;"> Make sure page is readable without any style sheet enabled