SlideShare a Scribd company logo
CSS
Cascading Style Sheets
Contents{
1. What is CSS?
1. A Brief History of CSS
2. Why to use Styles?
2. Syntax
3. Cascading Order
4. Examples of Properties
5. Limitations
6. CSS variations
{What is CSS?
 CSS stands for Cascading Style Sheets
 Styles define how to display (X)HTML elements
 Styles are normally stored in Style Sheets
 Multiple style definitions will cascade into one
{A Brief History of CSS
 Style sheets have existed since the beginnings of SGML in
the 1970s
 As HTML grew, it came to encompass a wider variety of
stylistic capabilities
 Nine different style sheet languages were proposed to
the W3C
 Two were chosen as the foundation for CSS: CHSS and
Stream-based Style Sheet Proposal
 CSS level 1 – 1996; CSS level 2 – 1997
 Difficulties with adoption
{Why to use Styles?
 Documents written with CSS are
 more flexible
 short
 clear
 Basic formating tool
 Easy multiple document managment
 Save time by using selector classes
 New opportunities in formating
Syntax
CSS
{ Basic Syntax
 Made up of three parts:
selector {property: value}
 The selector is normally the HTML element/tag you wish
to define
 The property is the attribute you wish to change
 Every property has the value
{ Syntax
 If the value is multiple words, put quotes around the
value
p {font-family: "sans serif"}
 To make the style definitions more readable, you
can describe one property on each line
p
{
text-align: center;
color: black;
font-family: arial
}
{ Grouping
h1,h2,h3,h4,h5,h6
{
color: green
}
 All header elements will be displayed in green text color
This is header h1
This is header h2
This is header h3
This is header h4
{ The class Selector
 With the class selector you can define different styles for
the same type of HTML element.
p.right {text-align: right}
p.center {text-align: center}
 Using the class argument in (X)HTML:
<p class="right"> This paragraph will be right-
aligned. </p>
<p class="center"> This paragraph will be
center-aligned. </p>
{ Text color
<html><head>
<style type="text/css">
h1 {color: green}
h2 {color: #dda0dd}
p {color: rgb(0,0,255)}
</style>
</head>
<body>
<h1>This is header 1</h1>
<h2>This is header 2</h2>
<p>This is a
paragraph</p>
</body>
</html>
This is header 1
This is header 2
This is a paragraph
Inserting of style sheet
CSS
{Cascading order
1. Browser default
2. External style sheet
 inside external *.css file
3. Internal style sheet
 inside the <head> tag
4. Inline style
 inside an HTML element
{External Style Sheet
 Each webpage must link
to the style sheet using
the <link> tag
 Browser reads styles
definitions from
mystyle.css file
<head>
<link
rel="stylesheet"
type="text/css"
href="mystyle.css" /
>
</head>
{ Internal Style Sheet
 Should be used when a
single document has a
unique style
 Defined in the head
section by using the
<style> tag
<head>
<style type="text/css">
hr {color: sienna}
p {margin-left: 20px}
body {background-image:
url("images/back40.gif")}
</style>
</head>
{ Multiple Style Sheets
 An internal style sheet has
following properties for the
h3 selector:
h3 { text-align: right;
font-size: 20pt }
 External style sheet has
these:
h3 { color: red;
text-align: left;
font-size: 8pt }
 Your Web Browser has
default formatting:
h3 { color: black;
font size: 10pt }
 What will be the format of
<h3> tag?
o color: red;
o text-align: right;
o font-size: 20pt
Examples
CSS Properties & values
{ Background:
 Control over the
background color of an
element
 set an image as the
background,
 repeat a background
image
 background-color
 color-rgb
color-hex
color-name
 background-image
 url(URL)
none
 background-repeat
 repeat
repeat-x
repeat-y
no-repeat
Css
{Text:
 color
 direction
 ltr
rtl
 word spacing
 normal
length
 text-decoration
 none
underline
overline
line-through
blink
 text-align
 left
right
center
justify
Css
{Font:
 font-family
• family-name
generic-family
 font-size
 xx-small
x-small
small
 /etc./
 font-weigh
 normal
bold
bolder
lighter
100
{Dimension
{List:
<head>
<style type="text/css">
ul
{
list-style-image: url('arrow.gif')
}
</style>
</head>
<body>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
</body>
CSS
Variations, Limitations
{CSS Limitations
 Some noted disadvantages of using "pure" CSS include
 Inconsistent browser support
 Absence of expressions
 Lack of Variables
 Lack of multiple backgrounds per element
 Control of Element Shapes
CSS level 1
 The first CSS specification to become an official W3C
Recommendation is CSS level 1, published in December
1996. Among its capabilities are support for:
 Font properties such as typeface and emphasis
 Color of text, backgrounds, and other elements
 Text attributes such as spacing between words, letters, and
lines of text
 Alignment of text, images, tables and other elements
 Margin, border, padding, and positioning for most elements
 Unique identification and generic classification of groups of
attributes
 The W3C maintains the CSS1 Recommendation.
CSS level 2
 published as a Recommendation in May 1998.
 includes a number of new capabilities
 absolute, relative, and fixed positioning of elements
 the concept of media types
 bidirectional text
 new font properties such as shadows
 The W3C maintains the CSS2 Recommendation.
 CSS level 2 revision 1 or CSS 2.1 fixes errors in CSS2
 returned to Candidate Recommendation status on 19 July
2007
Useful links
 http://www.w3schools.com/css/
 Learn CSS
 http://validator.w3.org/
 Check Your CSS syntax
 http://www.csszengarden.com/
 The beauty of CSS Design
 One HTML file
 210 CSS
http://www.csszengarden.com/
http://www.csszengarden.com/?cssfile=/209/209.css
http://www.csszengarden.com/?cssfile=/207/207.css
http://www.csszengarden.com/?cssfile=192/192.css
Zen Garden without formatting
Thank You for Your Attention
CSS

More Related Content

PPSX
Introduction to css
PPTX
Css starting
PPT
Cascading Style Sheet | CSS
PPTX
CSS introduction
PPTX
Web topic 15 1 basic css layout
PPTX
Cascading Style Sheets (CSS)
PPTX
Week 12 CSS - Review from last week
Introduction to css
Css starting
Cascading Style Sheet | CSS
CSS introduction
Web topic 15 1 basic css layout
Cascading Style Sheets (CSS)
Week 12 CSS - Review from last week

What's hot (19)

PPT
CSS Introduction
PPTX
Cascading style sheets (CSS)
PPTX
CSS Basic Introduction, Rules, And Tips
PPTX
Cascading Style Sheet (CSS)
PPTX
Cascading Style Sheet
PDF
Html and-css
PPTX
Html and-css
PPT
Cascading Style Sheets
PPTX
Html Styles-CSS
PDF
Web app development_html_css_03
PPSX
CSS tutorial
PPTX
Introducing Cascading Style Sheets
PPTX
The three types of style sheet lesson two fourth quarter fourth year
PPTX
Css ms megha
PPTX
Session v(css)
PPTX
PPT
ODP
Introduction to css & its attributes with syntax
CSS Introduction
Cascading style sheets (CSS)
CSS Basic Introduction, Rules, And Tips
Cascading Style Sheet (CSS)
Cascading Style Sheet
Html and-css
Html and-css
Cascading Style Sheets
Html Styles-CSS
Web app development_html_css_03
CSS tutorial
Introducing Cascading Style Sheets
The three types of style sheet lesson two fourth quarter fourth year
Css ms megha
Session v(css)
Introduction to css & its attributes with syntax
Ad

Viewers also liked (20)

PPTX
Relational database language
PPT
Cascading style sheets
PPTX
Chapter 7 relation database language
PPT
Chapter2
PPTX
Chapter 9 introduction to transaction processing
PPTX
Chapter 7 relation database language
PPT
Chapter3
PPT
Session1 gateway to web page development
PPTX
Introduction to transaction processing
PPT
Introduction to jsp
PPTX
Chapter 6 relational data model and relational
PPTX
Chapter 6 relational data model and relational
PPTX
Chapter 4 record storage and primary file organization
PPT
Chapter8 pl sql
PPTX
Chapter 7 relation database language
DOC
Dbms lab 01 termwork1
PPTX
Chapter 3 servlet & jsp
PPTX
Chapter1
Relational database language
Cascading style sheets
Chapter 7 relation database language
Chapter2
Chapter 9 introduction to transaction processing
Chapter 7 relation database language
Chapter3
Session1 gateway to web page development
Introduction to transaction processing
Introduction to jsp
Chapter 6 relational data model and relational
Chapter 6 relational data model and relational
Chapter 4 record storage and primary file organization
Chapter8 pl sql
Chapter 7 relation database language
Dbms lab 01 termwork1
Chapter 3 servlet & jsp
Chapter1
Ad

Similar to Css (20)

PDF
4. Web Technology CSS Basics-1
PPTX
Cascading Styling Sheets(CSS) simple design language intended to transform th...
PPTX
Cascading style sheet, CSS Box model, Table in CSS
PPTX
LIS3353 SP12 Week 13
PDF
cdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdf
PDF
CSCADING style sheet. Internal external inline
PDF
css-ppt.pdf
PPT
Cascading Style Sheet
PPTX
PPT
IP - Lecture 6, 7 Chapter-3 (3).ppt
PDF
Chapter 3 - CSS.pdf
PPT
Unit 2-CSS & Bootstrap.ppt
PPTX
cascading style sheets- About cascading style sheets on the selectors
PDF
ch-hguygureehuvnvdfduyertiuhrnhduuyfjh3.pdf
PPTX
CSS Basics (Cascading Style Sheet)
PPT
css-presentation.ppt
4. Web Technology CSS Basics-1
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading style sheet, CSS Box model, Table in CSS
LIS3353 SP12 Week 13
cdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdf
CSCADING style sheet. Internal external inline
css-ppt.pdf
Cascading Style Sheet
IP - Lecture 6, 7 Chapter-3 (3).ppt
Chapter 3 - CSS.pdf
Unit 2-CSS & Bootstrap.ppt
cascading style sheets- About cascading style sheets on the selectors
ch-hguygureehuvnvdfduyertiuhrnhduuyfjh3.pdf
CSS Basics (Cascading Style Sheet)
css-presentation.ppt

More from Jafar Nesargi (15)

PPTX
Network adpater,cabel,cards ,types, network devices
PPTX
An introduction to networking
PPTX
Computer basics Intro
PPT
Introduction to-oracle
PPTX
PPTX
Java bean
PPTX
Networking
PPTX
Chapter2 j2ee
PPTX
Chapter 1 swings
DOCX
Record storage and primary file organization
PPT
Introduction to-oracle
PPTX
Functional dependencies and normalization for relational databases
PPT
Database system concepts and architecture
PPT
Data modeling using the entity relationship model
PPT
Cascading style sheets
Network adpater,cabel,cards ,types, network devices
An introduction to networking
Computer basics Intro
Introduction to-oracle
Java bean
Networking
Chapter2 j2ee
Chapter 1 swings
Record storage and primary file organization
Introduction to-oracle
Functional dependencies and normalization for relational databases
Database system concepts and architecture
Data modeling using the entity relationship model
Cascading style sheets

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
GDM (1) (1).pptx small presentation for students
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Classroom Observation Tools for Teachers
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Trump Administration's workforce development strategy
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
O7-L3 Supply Chain Operations - ICLT Program
GDM (1) (1).pptx small presentation for students
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
202450812 BayCHI UCSC-SV 20250812 v17.pptx
RMMM.pdf make it easy to upload and study
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Weekly quiz Compilation Jan -July 25.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Module 4: Burden of Disease Tutorial Slides S2 2025
Classroom Observation Tools for Teachers
A systematic review of self-coping strategies used by university students to ...
Trump Administration's workforce development strategy
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Microbial diseases, their pathogenesis and prophylaxis
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
VCE English Exam - Section C Student Revision Booklet

Css

  • 2. Contents{ 1. What is CSS? 1. A Brief History of CSS 2. Why to use Styles? 2. Syntax 3. Cascading Order 4. Examples of Properties 5. Limitations 6. CSS variations
  • 3. {What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display (X)HTML elements  Styles are normally stored in Style Sheets  Multiple style definitions will cascade into one
  • 4. {A Brief History of CSS  Style sheets have existed since the beginnings of SGML in the 1970s  As HTML grew, it came to encompass a wider variety of stylistic capabilities  Nine different style sheet languages were proposed to the W3C  Two were chosen as the foundation for CSS: CHSS and Stream-based Style Sheet Proposal  CSS level 1 – 1996; CSS level 2 – 1997  Difficulties with adoption
  • 5. {Why to use Styles?  Documents written with CSS are  more flexible  short  clear  Basic formating tool  Easy multiple document managment  Save time by using selector classes  New opportunities in formating
  • 7. { Basic Syntax  Made up of three parts: selector {property: value}  The selector is normally the HTML element/tag you wish to define  The property is the attribute you wish to change  Every property has the value
  • 8. { Syntax  If the value is multiple words, put quotes around the value p {font-family: "sans serif"}  To make the style definitions more readable, you can describe one property on each line p { text-align: center; color: black; font-family: arial }
  • 9. { Grouping h1,h2,h3,h4,h5,h6 { color: green }  All header elements will be displayed in green text color This is header h1 This is header h2 This is header h3 This is header h4
  • 10. { The class Selector  With the class selector you can define different styles for the same type of HTML element. p.right {text-align: right} p.center {text-align: center}  Using the class argument in (X)HTML: <p class="right"> This paragraph will be right- aligned. </p> <p class="center"> This paragraph will be center-aligned. </p>
  • 11. { Text color <html><head> <style type="text/css"> h1 {color: green} h2 {color: #dda0dd} p {color: rgb(0,0,255)} </style> </head> <body> <h1>This is header 1</h1> <h2>This is header 2</h2> <p>This is a paragraph</p> </body> </html> This is header 1 This is header 2 This is a paragraph
  • 12. Inserting of style sheet CSS
  • 13. {Cascading order 1. Browser default 2. External style sheet  inside external *.css file 3. Internal style sheet  inside the <head> tag 4. Inline style  inside an HTML element
  • 14. {External Style Sheet  Each webpage must link to the style sheet using the <link> tag  Browser reads styles definitions from mystyle.css file <head> <link rel="stylesheet" type="text/css" href="mystyle.css" / > </head>
  • 15. { Internal Style Sheet  Should be used when a single document has a unique style  Defined in the head section by using the <style> tag <head> <style type="text/css"> hr {color: sienna} p {margin-left: 20px} body {background-image: url("images/back40.gif")} </style> </head>
  • 16. { Multiple Style Sheets  An internal style sheet has following properties for the h3 selector: h3 { text-align: right; font-size: 20pt }  External style sheet has these: h3 { color: red; text-align: left; font-size: 8pt }  Your Web Browser has default formatting: h3 { color: black; font size: 10pt }  What will be the format of <h3> tag? o color: red; o text-align: right; o font-size: 20pt
  • 18. { Background:  Control over the background color of an element  set an image as the background,  repeat a background image  background-color  color-rgb color-hex color-name  background-image  url(URL) none  background-repeat  repeat repeat-x repeat-y no-repeat
  • 20. {Text:  color  direction  ltr rtl  word spacing  normal length  text-decoration  none underline overline line-through blink  text-align  left right center justify
  • 22. {Font:  font-family • family-name generic-family  font-size  xx-small x-small small  /etc./  font-weigh  normal bold bolder lighter 100
  • 26. {CSS Limitations  Some noted disadvantages of using "pure" CSS include  Inconsistent browser support  Absence of expressions  Lack of Variables  Lack of multiple backgrounds per element  Control of Element Shapes
  • 27. CSS level 1  The first CSS specification to become an official W3C Recommendation is CSS level 1, published in December 1996. Among its capabilities are support for:  Font properties such as typeface and emphasis  Color of text, backgrounds, and other elements  Text attributes such as spacing between words, letters, and lines of text  Alignment of text, images, tables and other elements  Margin, border, padding, and positioning for most elements  Unique identification and generic classification of groups of attributes  The W3C maintains the CSS1 Recommendation.
  • 28. CSS level 2  published as a Recommendation in May 1998.  includes a number of new capabilities  absolute, relative, and fixed positioning of elements  the concept of media types  bidirectional text  new font properties such as shadows  The W3C maintains the CSS2 Recommendation.  CSS level 2 revision 1 or CSS 2.1 fixes errors in CSS2  returned to Candidate Recommendation status on 19 July 2007
  • 29. Useful links  http://www.w3schools.com/css/  Learn CSS  http://validator.w3.org/  Check Your CSS syntax  http://www.csszengarden.com/  The beauty of CSS Design  One HTML file  210 CSS
  • 34. Zen Garden without formatting
  • 35. Thank You for Your Attention CSS