SlideShare a Scribd company logo
1 of 23
IInnttrroodduuccttiioonn 
TToo CCSSSS
HHTTMMLL RReevviieeww 
►What is HTML used for? 
►Give some examples of formatting tags in 
HTML? 
►HTML is the most widely used language on the 
Web 
►In today’s lesson we will be discussing the 
second most widely used language on the web 
►Does anyone know the name of the second most 
widely used language?
HHiissttoorryy ooff CCSSSS 
►CSS was proposed in 1994 as a web styling 
language. 
►There were other styling languages 
proposed at this time, such as Style Sheets 
for HTML and JSSS but CSS won. 
►CSS2 became the recommendation in 1998 
by W3C 
►CSS3 was started in 1998 but it has never 
been completed. Some parts are still being 
developed and some components work on 
some browsers.
WWhhaatt iiss CCSSSS?? 
• CCSSSS ssttaannddss ffoorr CCaassccaaddiinngg SSttyyllee SShheeeettss 
• SSttyylleess -- ddeeffiinnee hhooww ttoo ddiissppllaayy HHTTMMLL eelleemmeennttss 
• SSttyylleess aarree nnoorrmmaallllyy ssttoorreedd iinn SSttyyllee SShheeeettss 
DDeeffiinniittiioonn:: 
Cascading Style Sheets (CSS) – is a rule based 
language that applies styling to your HTML elements. 
You write CSS rules in elements, and modify properties 
of those elements such as color, background color, 
width, border thickness, font size, etc.
HHTTMMLL FFoorrmmaattttiinngg RReevviieeww 
►WWhhaatt aarree tthhee ssttaarrttiinngg ttaaggss iinn HHTTMMLL?? 
►WWhhaatt aarree tthhee eennddiinngg ttaaggss iinn HHTTMMLL?? 
►HHooww ddoo yyoouu ssaavvee iinn aa NNootteeppaadd ddooccuummeenntt ssoo iitt 
bbeeccoommeess aa wweebb ppaaggee?? 
►WWhhaatt iiss tthhee ttaagg ffoorr ccrreeaattiinngg ppaarraaggrraapphhss iinn 
HHTTMMLL?? 
►WWhhaatt iiss tthhee ttaagg ffoorr ccrreeaattiinngg hheeaaddiinngg ttaaggss iinn 
HHTTMMLL?? 
►WWhhaatt aarree tthhee ttaaggss wwee uussee ttoo ffoorrmmaatt ffoonntt:: ffaammiillyy,, 
ccoolloorr,, ssiizzee,, aalliiggnnmmeenntt iinn HHTTMMLL??
SSyynnttaaxx ooFF CCSSSS 
 TThhee CCSSSS ssyynnttaaxx iiss mmaaddee uupp ooff 55 ppaarrttss:: 
 sseelleeccttoorr 
 PPrrooppeerrttyy&&vvaalluuee 
 ddeeccllaarraattiioonn 
 ddeeccllaarraattiioonn bblloocckk 
 ccuurrllyy bbrraacceess
SSeelleeccttoorr 
 DDeeffiinniittiioonn:: iiddeennttiiffiieess tthhee HHTTMMLL eelleemmeennttss tthhaatt tthhee 
rruullee wwiillll bbee aapppplliieedd ttoo,, iiddeennttiiffiieedd bbyy tthhee aaccttuuaall 
eelleemmeenntt nnaammee,, ee..gg.. <<bbooddyy>>,, oorr bbyy ootthheerr mmeeaannss 
ssuucchh aass ccllaassss aattttrriibbuuttee vvaalluueess.. 
 EExxaammppllee:: 
*The selector is normally the HTML element you want to style
PPrrooppeerrttyy && VVaalluuee 
 DDeeffiinniittiioonn:: The property is the style attribute you 
want to change. Each property has a value. 
**PPrrooppeerrttiieess aarree sseeppaarraatteedd ffrroomm tthheeiirr rreessppeeccttiivvee vvaalluueess bbyy 
ccoolloonnss :: 
*PPaaiirrss aarree sseeppaarraatteedd ffrroomm eeaacchh ootthheerr bbyy sseemmiiccoolloonnss ;;
DDeeccllaarraattiioonn 
 DDeeffiinniittiioonn:: EEaacchh CCSSSS lliinnee tthhaatt iinncclluuddeess pprrooppeerrttyy 
aanndd vvaalluuee 
*Each declaration consists of a property and a value.
DDeeccllaarraattiioonn BBlloocckk 
DDeeffiinniittiioonn:: mmuullttiippllee ddeeccllaarraattiioonn lliinneess iinncclluuddiinngg tthhee 
ccuurrllyy bbrraacceess
CCuurrllyy BBrraacceess 
 DDeeffiinniittiioonn:: tthhee ccuurrllyy bbrraacceess ccoonnttaaiinn tthhee 
pprrooppeerrttiieess ooff tthhee eelleemmeenntt yyoouu wwaanntt ttoo 
mmaanniippuullaattee,, aanndd tthhee vvaalluueess tthhaatt yyoouu wwaanntt ttoo 
cchhaannggee tthheemm ttoo.. TThhee ccuurrllyy bbrraacceess pplluuss tthheeiirr 
ccoonntteenntt iiss ccaalllleedd aa ddeeccllaarraattiioonn bblloocckk.. 
 EExxaammppllee::
EEgg FFoorr SSiimmppllee CCSSSS PPaaggee 
<<hhttmmll>> 
<<hheeaadd>> 
<<ssttyyllee ttyyppee==""tteexxtt//ccssss"">> 
pp {{ ccoolloorr::rreedd;; tteexxtt--aalliiggnn::cceenntteerr;; }} 
<<//ssttyyllee>> 
<<//hheeaadd>> 
<<bbooddyy>> 
<<pp>>HHeelllloo WWoorrlldd!!<<//pp>> 
<<pp>>TThhiiss ppaarraaggrraapphh iiss ssttyylleedd wwiitthh CCSSSS..<<//pp>> 
<<//bbooddyy>> 
<<//hhttmmll>>
How CSS is Applied ttoo AA WWeebb PPaaggee 
►CCSSSS iiss aapppplliieedd ttoo aa wweebb ppaaggee uussiinngg tthhrreeee 
ddiiffffeerreenntt mmeetthhooddss:: 
 IInnlliinnee ssttyyllee 
 IInntteerrnnaall ssttyyllee sshheeeett 
 EExxtteerrnnaall ssttyyllee sshheeeett
HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee 
►IInnlliinnee CCSSSS 
►AApppplliieess ssttyylleess ddiirreeccttllyy ttoo tthhee eelleemmeennttss bbyy 
aaddddiinngg ddeeccllaarraattiioonnss iinnttoo tthhee ssttyyllee 
►FFoorr EExxaammppllee:: 
<<pp ssttyyllee==““ccoolloorr:: rreedd;;””>> TThhiiss iiss aa ssiimmppllee 
ppaarraaggrraapphh aanndd tthhee iinnlliinnee ssttyyllee mmaakkeess iitt 
rreedd..<<//pp>>
HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee 
► IInntteerrnnaall SSttyyllee SShheeeett 
► AApppplliieess ssttyylleess ttoo HHTTMMLL bbyy ppllaacciinngg tthhee CCSSSS rruulleess iinnssiiddee tthhee ttaagg 
<<ssttyyllee>> iinnssiiddee tthhee ddooccuummeenntt ttaagg <<hheeaadd>>.. 
► FFoorr EExxaammppllee:: 
<<hheeaadd>> 
<<ttiittllee>>mmyy ppaaggee<<//ttiittllee>> 
<<ssttyyllee ttyyppee==““tteexxtt//ccssss””>> 
pp{{ccoolloorr::rreedd}}<<//ssttyyllee>> 
<<//hheeaadd>> 
<<bbooddyy>> 
<<pp>>tthhiiss iiss aa ssiimmppllee ppaarraaggrraapphh 
<<//pp>> 
<<//bbooddyy>>
HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee 
► EExxtteerrnnaall CCSSSS 
► AApppplliieess ssttyylleess aass aa sseeppaarraattee ffiillee wwiitthh aa ..ccssss eexxtteennssiioonn.. TThhee ffiillee iiss 
tthheenn rreeffeerreenncceedd ffrroomm iinnssiiddee tthhee <<hheeaadd>> eelleemmeenntt bbyy aa lliinnkk ttoo tthhee 
ffiillee.. 
► FFoorr EExxaammppllee:: 
<<hheeaadd>> 
<<ttiittllee>>mmyy eexxtteerrnnaall ssttyyllee sshheeeett ppaaggee<<//ttiittllee>> 
<<lliinnkk rreell==““ssttyyllee sshheeeett”” ttyyppee==““tteexxtt//ccssss”” hhrreeff==““mmyy--eexxtteerrnnaall-- 
ssttyylleesshheeeett..ccssss””>> 
<<bbooddyy>> 
<<pp>>tthhiiss iiss aa ssiimmppllee ppaarraaggrraapphh<<//pp>> 
<<//bbooddyy>> 
► YYoouu ccaann ccrreeaattee aann eexxtteerrnnaall ssttyyllee sshheeeett iinn yyoouurr tteexxtt eeddiittoorr..
HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee 
► WWhhaatt ssttyyllee sshheeeett iiss bbeesstt?? 
► WWeebb ddeevveellooppeerrss rraarreellyy uussee iinnlliinnee CCSSSS.. SSiinnccee tthheeyy pprreeffeerr 
ttoo nnoott mmiixx ccoonntteenntt wwiitthh pprreesseennttaattiioonn.. AAnndd iitt iiss nnoott 
eeffffiicciieenntt ssiinnccee yyoouu hhaavvee ttoo ddeeccllaarree tthhee ssttyyllee iinnddiivviidduuaallllyy 
ffoorr eevveerryy ccoommppoonneenntt.. 
► IInntteerrnnaall aanndd EExxtteerrnnaall ssttyyllee sshheeeettss aarree mmoorree ppooppuullaarr 
bbeeccaauussee yyoouu ccaann ssttyyllee mmuullttiippllee eelleemmeennttss wwiitthh oonnee rruullee.. 
► EExxtteerrnnaall ssttyyllee sshheeeettss aarree bbeesstt bbeeccaauussee tthheeyy aallllooww yyoouu ttoo 
ssaavvee aallll tthhee ssttyyllee iinnffoorrmmaattiioonn oonn aa sseeppaarraattee ffiillee ffrroomm tthhee 
ccoonntteenntt.. YYoouu ccaann tthheenn mmooddiiffyy aa ssttyyllee ffoorr aa ssiittee aanndd iitt wwiillll 
uuppddaattee aallll ooff tthhee ppaaggeess iinn aa ssiittee..
CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS 
►CCSSSS CCoolloorrss 
►IInn tthhee pprreevviioouuss yyoouu hhaavvee sseeeenn aa ffeeww CCSSSS 
ssttyylleess tthhaatt iinncclluuddeedd ccoolloorr lliikkee:: <<pp 
ssttyyllee==““ccoolloorr:: rreedd;;””>> 
►TThheerree aarree aa ffeeww wwaayyss tthhaatt yyoouu ccaann sseett 
ccoolloorrss iinn CCSSSS:: 
KKeeyywwoorrddss,, HHeexx vvaalluueess,, RRGGBB,, HHSSLL((aa))
CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS 
►CCSSSS CCoolloorrss:: KKeeyywwoorrddss 
►UUssiinngg tthhee kkeeyywwoorrddss lliikkee:: rreedd,, ffuucchhssiiaa,, yyeellllooww,, 
bblluuee,, ggrreeeenn yyoouu ccaann ssppeecciiffyy wwhhaatt ccoolloorr yyoouu wwoouulldd 
lliikkee tthhee CCSSSS rruullee ttoo ddiissppllaayy.. 
►FFoorr eexxaammppllee:: 
►pp{{ccoolloorr::rreedd}} 
►hh22{{ccoolloorr::yyeellllooww}} 
►TThheerree aarree 1177 ooff tthheessee kkeeyywwoorrdd ccoolloorrss yyoouu ccaann 
uussee iinn CCSSSS..
CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS 
KKeeyywwoorrdd CCoolloorr HHeexx 
aqua #00ffff 
black #000000 
blue #0000ff 
fuchsia #ff00ff 
gray #808080 
green #008000 
lime #00ff00 
maroon #800000 
navy #000080 
olive #808000 
orange (added in CSS 2.1) #ffa500 
purple #800080 
red #ff0000 
silver #c0c0c0 
teal #008080 
white #ffffff 
yellow #ffff00
CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS 
►Computers are ccaappaabbllee ooff ddiissppllaayyiinngg aa lloott mmoorree 
tthhaann 1177 ccoolloorrss.. 
►IInn ffaacctt tthheeyy ccaann ddiissppllaayy aapppprrooxxiimmaatteellyy 1166..77 
mmiilllliioonn ccoolloorrss!! 
►HHeexx VVaalluueess ((hheexx iiss sshhoorrtt ffoorr hheexxaaddeecciimmaall)) aarree 
tthhee mmoosstt ccoommmmoonn wwaayy ooff ssppeecciiffyyiinngg ccoolloorrss ffoorr 
wweebb ppaaggeess.. ((sseeee hheexx## iinn tthhee pprreevviioouuss cchhaarrtt)) 
►FFoorr eexxaammppllee:: 
pp{{ccoolloorr:: ##000000000000;;}} 
//**TThhiiss iiss eeqquuiivvaalleenntt ttoo tthhee kkeeyywwoorrdd bbllaacckk**//
CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS 
►HHeexx nnuummbbeerrss -- hhaass 1166 ppoossssiibbllee vvaalluueess 
►00 ttoo 99 tthheenn AA ttoo FF.. WWhhiicchh ggiivveess yyoouu 1166 
vvaalluueess.. 
►RRGGBB ((RReedd GGrreeeenn BBlluuee)) hhaass tthhee ppoossssiibbiilliittyy 
ooff 225566 ccoolloorrss ffoorr eeaacchh ((1166xx1166)) 
►((RR))225566 xx ((GG))225566 xx ((BB))225566 = 1166,,777777,,221166 oorr 
1166..77 mmiilllliioonn ccoolloorr vvaalluueess 
►CCSSSS eexxaammppllee:: hh11{{ccoolloorr:: ##000000000000;;}}
TThhaannkk YYoouu !!

More Related Content

What's hot

What's hot (20)

FISIKA TANAH
FISIKA TANAHFISIKA TANAH
FISIKA TANAH
 
Command Channel Slides Week Between Sept. 26 to Oct. 2
Command Channel Slides Week Between Sept. 26 to Oct. 2Command Channel Slides Week Between Sept. 26 to Oct. 2
Command Channel Slides Week Between Sept. 26 to Oct. 2
 
Christian courtship 4
Christian courtship   4Christian courtship   4
Christian courtship 4
 
The complement system
The complement systemThe complement system
The complement system
 
A true woman 5
A true woman   5A true woman   5
A true woman 5
 
Team+work
Team+workTeam+work
Team+work
 
True love 6
True love   6True love   6
True love 6
 
Application of An Artificial Neural Network
Application of An Artificial Neural Network Application of An Artificial Neural Network
Application of An Artificial Neural Network
 
Tema 1 tectónica de placas
Tema 1 tectónica de placasTema 1 tectónica de placas
Tema 1 tectónica de placas
 
Bermuda triangle
Bermuda triangleBermuda triangle
Bermuda triangle
 
Former Chapter 3
Former Chapter 3 Former Chapter 3
Former Chapter 3
 
CheckFood - startup pitch-updated
CheckFood  - startup pitch-updatedCheckFood  - startup pitch-updated
CheckFood - startup pitch-updated
 
gurjinder(Resume)
gurjinder(Resume)gurjinder(Resume)
gurjinder(Resume)
 
How to Network in Your Community
How to Network in Your CommunityHow to Network in Your Community
How to Network in Your Community
 
Command Channel Slides Week Between Oct. 31 to Nov. 6
Command Channel Slides Week Between Oct. 31 to Nov. 6Command Channel Slides Week Between Oct. 31 to Nov. 6
Command Channel Slides Week Between Oct. 31 to Nov. 6
 
08 Feedback
08 Feedback08 Feedback
08 Feedback
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
kelas xi : Bab I budaya pol di ind
kelas xi : Bab I budaya pol di indkelas xi : Bab I budaya pol di ind
kelas xi : Bab I budaya pol di ind
 
2074 - APELAÇÃO CPC Atualizado 2018
2074 - APELAÇÃO CPC Atualizado 20182074 - APELAÇÃO CPC Atualizado 2018
2074 - APELAÇÃO CPC Atualizado 2018
 
Source control system
Source control systemSource control system
Source control system
 

Viewers also liked

Viewers also liked (6)

Qué es la creatividad
Qué es la creatividadQué es la creatividad
Qué es la creatividad
 
Bases y sales
Bases y salesBases y sales
Bases y sales
 
Richar
RicharRichar
Richar
 
Acto creativo de grupo 5 guillermo leon 7e copia
Acto creativo de grupo 5 guillermo leon 7e   copiaActo creativo de grupo 5 guillermo leon 7e   copia
Acto creativo de grupo 5 guillermo leon 7e copia
 
Atributos de dios, varón, trinidad
Atributos de dios, varón, trinidadAtributos de dios, varón, trinidad
Atributos de dios, varón, trinidad
 
Los atributos de dios
Los atributos de diosLos atributos de dios
Los atributos de dios
 

Similar to Cascaded styling sheets Intro

Introduction to microsoft access ppt
Introduction to microsoft access pptIntroduction to microsoft access ppt
Introduction to microsoft access pptranjitkumar08
 
Microsoft excel tutorial06
Microsoft excel tutorial06Microsoft excel tutorial06
Microsoft excel tutorial06Athar Mutahari
 
stem cells for lung diseases
stem cells for lung diseasesstem cells for lung diseases
stem cells for lung diseasesmousa elshamly
 
Cutting safety ppt vivek nirwal
Cutting safety ppt vivek nirwalCutting safety ppt vivek nirwal
Cutting safety ppt vivek nirwalvivek nirwal
 
Top school in delhi ncr
Top school in delhi ncrTop school in delhi ncr
Top school in delhi ncrEdhole.com
 
2011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp012011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp01Ariunaa Nasan-Ochir
 
Fluid & electrolytes & acid base
Fluid & electrolytes & acid baseFluid & electrolytes & acid base
Fluid & electrolytes & acid baseMichelle Harris
 
Call Centre Training Package
Call Centre Training PackageCall Centre Training Package
Call Centre Training PackageStephen J Landry
 
Alkaloids introduction
Alkaloids introductionAlkaloids introduction
Alkaloids introductionHifzul Kabir
 
The New Marketing Paradigm - Kotler
The New Marketing Paradigm - KotlerThe New Marketing Paradigm - Kotler
The New Marketing Paradigm - KotlerFilipe Mello
 
The beach pwpt
The beach pwptThe beach pwpt
The beach pwptlynette9
 
18 Hash tables and sets
18 Hash tables and sets18 Hash tables and sets
18 Hash tables and setsmaznabili
 
Pso slide presentation ccesl roll out 2007
Pso slide presentation   ccesl roll out 2007Pso slide presentation   ccesl roll out 2007
Pso slide presentation ccesl roll out 2007Katie Scollin Flowers
 
Manajemen organisasi mahasiswa
Manajemen organisasi mahasiswaManajemen organisasi mahasiswa
Manajemen organisasi mahasiswaRizky Rahman
 

Similar to Cascaded styling sheets Intro (20)

Introduction to microsoft access ppt
Introduction to microsoft access pptIntroduction to microsoft access ppt
Introduction to microsoft access ppt
 
Microsoft excel tutorial06
Microsoft excel tutorial06Microsoft excel tutorial06
Microsoft excel tutorial06
 
HTML basic
HTML basicHTML basic
HTML basic
 
Tkam
TkamTkam
Tkam
 
stem cells for lung diseases
stem cells for lung diseasesstem cells for lung diseases
stem cells for lung diseases
 
Cutting safety ppt vivek nirwal
Cutting safety ppt vivek nirwalCutting safety ppt vivek nirwal
Cutting safety ppt vivek nirwal
 
Top school in delhi ncr
Top school in delhi ncrTop school in delhi ncr
Top school in delhi ncr
 
2011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp012011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp01
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
 
Fluid & electrolytes & acid base
Fluid & electrolytes & acid baseFluid & electrolytes & acid base
Fluid & electrolytes & acid base
 
Call Centre Training Package
Call Centre Training PackageCall Centre Training Package
Call Centre Training Package
 
Lectec e-brochure
Lectec e-brochureLectec e-brochure
Lectec e-brochure
 
Alkaloids introduction
Alkaloids introductionAlkaloids introduction
Alkaloids introduction
 
The New Marketing Paradigm - Kotler
The New Marketing Paradigm - KotlerThe New Marketing Paradigm - Kotler
The New Marketing Paradigm - Kotler
 
The beach pwpt
The beach pwptThe beach pwpt
The beach pwpt
 
Stress management YP
Stress management YPStress management YP
Stress management YP
 
18 Hash tables and sets
18 Hash tables and sets18 Hash tables and sets
18 Hash tables and sets
 
Pso slide presentation ccesl roll out 2007
Pso slide presentation   ccesl roll out 2007Pso slide presentation   ccesl roll out 2007
Pso slide presentation ccesl roll out 2007
 
Manajemen organisasi mahasiswa
Manajemen organisasi mahasiswaManajemen organisasi mahasiswa
Manajemen organisasi mahasiswa
 
CV
CVCV
CV
 

Cascaded styling sheets Intro

  • 2. HHTTMMLL RReevviieeww ►What is HTML used for? ►Give some examples of formatting tags in HTML? ►HTML is the most widely used language on the Web ►In today’s lesson we will be discussing the second most widely used language on the web ►Does anyone know the name of the second most widely used language?
  • 3. HHiissttoorryy ooff CCSSSS ►CSS was proposed in 1994 as a web styling language. ►There were other styling languages proposed at this time, such as Style Sheets for HTML and JSSS but CSS won. ►CSS2 became the recommendation in 1998 by W3C ►CSS3 was started in 1998 but it has never been completed. Some parts are still being developed and some components work on some browsers.
  • 4. WWhhaatt iiss CCSSSS?? • CCSSSS ssttaannddss ffoorr CCaassccaaddiinngg SSttyyllee SShheeeettss • SSttyylleess -- ddeeffiinnee hhooww ttoo ddiissppllaayy HHTTMMLL eelleemmeennttss • SSttyylleess aarree nnoorrmmaallllyy ssttoorreedd iinn SSttyyllee SShheeeettss DDeeffiinniittiioonn:: Cascading Style Sheets (CSS) – is a rule based language that applies styling to your HTML elements. You write CSS rules in elements, and modify properties of those elements such as color, background color, width, border thickness, font size, etc.
  • 5. HHTTMMLL FFoorrmmaattttiinngg RReevviieeww ►WWhhaatt aarree tthhee ssttaarrttiinngg ttaaggss iinn HHTTMMLL?? ►WWhhaatt aarree tthhee eennddiinngg ttaaggss iinn HHTTMMLL?? ►HHooww ddoo yyoouu ssaavvee iinn aa NNootteeppaadd ddooccuummeenntt ssoo iitt bbeeccoommeess aa wweebb ppaaggee?? ►WWhhaatt iiss tthhee ttaagg ffoorr ccrreeaattiinngg ppaarraaggrraapphhss iinn HHTTMMLL?? ►WWhhaatt iiss tthhee ttaagg ffoorr ccrreeaattiinngg hheeaaddiinngg ttaaggss iinn HHTTMMLL?? ►WWhhaatt aarree tthhee ttaaggss wwee uussee ttoo ffoorrmmaatt ffoonntt:: ffaammiillyy,, ccoolloorr,, ssiizzee,, aalliiggnnmmeenntt iinn HHTTMMLL??
  • 6. SSyynnttaaxx ooFF CCSSSS  TThhee CCSSSS ssyynnttaaxx iiss mmaaddee uupp ooff 55 ppaarrttss::  sseelleeccttoorr  PPrrooppeerrttyy&&vvaalluuee  ddeeccllaarraattiioonn  ddeeccllaarraattiioonn bblloocckk  ccuurrllyy bbrraacceess
  • 7. SSeelleeccttoorr  DDeeffiinniittiioonn:: iiddeennttiiffiieess tthhee HHTTMMLL eelleemmeennttss tthhaatt tthhee rruullee wwiillll bbee aapppplliieedd ttoo,, iiddeennttiiffiieedd bbyy tthhee aaccttuuaall eelleemmeenntt nnaammee,, ee..gg.. <<bbooddyy>>,, oorr bbyy ootthheerr mmeeaannss ssuucchh aass ccllaassss aattttrriibbuuttee vvaalluueess..  EExxaammppllee:: *The selector is normally the HTML element you want to style
  • 8. PPrrooppeerrttyy && VVaalluuee  DDeeffiinniittiioonn:: The property is the style attribute you want to change. Each property has a value. **PPrrooppeerrttiieess aarree sseeppaarraatteedd ffrroomm tthheeiirr rreessppeeccttiivvee vvaalluueess bbyy ccoolloonnss :: *PPaaiirrss aarree sseeppaarraatteedd ffrroomm eeaacchh ootthheerr bbyy sseemmiiccoolloonnss ;;
  • 9. DDeeccllaarraattiioonn  DDeeffiinniittiioonn:: EEaacchh CCSSSS lliinnee tthhaatt iinncclluuddeess pprrooppeerrttyy aanndd vvaalluuee *Each declaration consists of a property and a value.
  • 10. DDeeccllaarraattiioonn BBlloocckk DDeeffiinniittiioonn:: mmuullttiippllee ddeeccllaarraattiioonn lliinneess iinncclluuddiinngg tthhee ccuurrllyy bbrraacceess
  • 11. CCuurrllyy BBrraacceess  DDeeffiinniittiioonn:: tthhee ccuurrllyy bbrraacceess ccoonnttaaiinn tthhee pprrooppeerrttiieess ooff tthhee eelleemmeenntt yyoouu wwaanntt ttoo mmaanniippuullaattee,, aanndd tthhee vvaalluueess tthhaatt yyoouu wwaanntt ttoo cchhaannggee tthheemm ttoo.. TThhee ccuurrllyy bbrraacceess pplluuss tthheeiirr ccoonntteenntt iiss ccaalllleedd aa ddeeccllaarraattiioonn bblloocckk..  EExxaammppllee::
  • 12. EEgg FFoorr SSiimmppllee CCSSSS PPaaggee <<hhttmmll>> <<hheeaadd>> <<ssttyyllee ttyyppee==""tteexxtt//ccssss"">> pp {{ ccoolloorr::rreedd;; tteexxtt--aalliiggnn::cceenntteerr;; }} <<//ssttyyllee>> <<//hheeaadd>> <<bbooddyy>> <<pp>>HHeelllloo WWoorrlldd!!<<//pp>> <<pp>>TThhiiss ppaarraaggrraapphh iiss ssttyylleedd wwiitthh CCSSSS..<<//pp>> <<//bbooddyy>> <<//hhttmmll>>
  • 13. How CSS is Applied ttoo AA WWeebb PPaaggee ►CCSSSS iiss aapppplliieedd ttoo aa wweebb ppaaggee uussiinngg tthhrreeee ddiiffffeerreenntt mmeetthhooddss::  IInnlliinnee ssttyyllee  IInntteerrnnaall ssttyyllee sshheeeett  EExxtteerrnnaall ssttyyllee sshheeeett
  • 14. HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee ►IInnlliinnee CCSSSS ►AApppplliieess ssttyylleess ddiirreeccttllyy ttoo tthhee eelleemmeennttss bbyy aaddddiinngg ddeeccllaarraattiioonnss iinnttoo tthhee ssttyyllee ►FFoorr EExxaammppllee:: <<pp ssttyyllee==““ccoolloorr:: rreedd;;””>> TThhiiss iiss aa ssiimmppllee ppaarraaggrraapphh aanndd tthhee iinnlliinnee ssttyyllee mmaakkeess iitt rreedd..<<//pp>>
  • 15. HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee ► IInntteerrnnaall SSttyyllee SShheeeett ► AApppplliieess ssttyylleess ttoo HHTTMMLL bbyy ppllaacciinngg tthhee CCSSSS rruulleess iinnssiiddee tthhee ttaagg <<ssttyyllee>> iinnssiiddee tthhee ddooccuummeenntt ttaagg <<hheeaadd>>.. ► FFoorr EExxaammppllee:: <<hheeaadd>> <<ttiittllee>>mmyy ppaaggee<<//ttiittllee>> <<ssttyyllee ttyyppee==““tteexxtt//ccssss””>> pp{{ccoolloorr::rreedd}}<<//ssttyyllee>> <<//hheeaadd>> <<bbooddyy>> <<pp>>tthhiiss iiss aa ssiimmppllee ppaarraaggrraapphh <<//pp>> <<//bbooddyy>>
  • 16. HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee ► EExxtteerrnnaall CCSSSS ► AApppplliieess ssttyylleess aass aa sseeppaarraattee ffiillee wwiitthh aa ..ccssss eexxtteennssiioonn.. TThhee ffiillee iiss tthheenn rreeffeerreenncceedd ffrroomm iinnssiiddee tthhee <<hheeaadd>> eelleemmeenntt bbyy aa lliinnkk ttoo tthhee ffiillee.. ► FFoorr EExxaammppllee:: <<hheeaadd>> <<ttiittllee>>mmyy eexxtteerrnnaall ssttyyllee sshheeeett ppaaggee<<//ttiittllee>> <<lliinnkk rreell==““ssttyyllee sshheeeett”” ttyyppee==““tteexxtt//ccssss”” hhrreeff==““mmyy--eexxtteerrnnaall-- ssttyylleesshheeeett..ccssss””>> <<bbooddyy>> <<pp>>tthhiiss iiss aa ssiimmppllee ppaarraaggrraapphh<<//pp>> <<//bbooddyy>> ► YYoouu ccaann ccrreeaattee aann eexxtteerrnnaall ssttyyllee sshheeeett iinn yyoouurr tteexxtt eeddiittoorr..
  • 17. HHooww CCSSSS iiss AApppplliieedd ttoo AA WWeebb PPaaggee ► WWhhaatt ssttyyllee sshheeeett iiss bbeesstt?? ► WWeebb ddeevveellooppeerrss rraarreellyy uussee iinnlliinnee CCSSSS.. SSiinnccee tthheeyy pprreeffeerr ttoo nnoott mmiixx ccoonntteenntt wwiitthh pprreesseennttaattiioonn.. AAnndd iitt iiss nnoott eeffffiicciieenntt ssiinnccee yyoouu hhaavvee ttoo ddeeccllaarree tthhee ssttyyllee iinnddiivviidduuaallllyy ffoorr eevveerryy ccoommppoonneenntt.. ► IInntteerrnnaall aanndd EExxtteerrnnaall ssttyyllee sshheeeettss aarree mmoorree ppooppuullaarr bbeeccaauussee yyoouu ccaann ssttyyllee mmuullttiippllee eelleemmeennttss wwiitthh oonnee rruullee.. ► EExxtteerrnnaall ssttyyllee sshheeeettss aarree bbeesstt bbeeccaauussee tthheeyy aallllooww yyoouu ttoo ssaavvee aallll tthhee ssttyyllee iinnffoorrmmaattiioonn oonn aa sseeppaarraattee ffiillee ffrroomm tthhee ccoonntteenntt.. YYoouu ccaann tthheenn mmooddiiffyy aa ssttyyllee ffoorr aa ssiittee aanndd iitt wwiillll uuppddaattee aallll ooff tthhee ppaaggeess iinn aa ssiittee..
  • 18. CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS ►CCSSSS CCoolloorrss ►IInn tthhee pprreevviioouuss yyoouu hhaavvee sseeeenn aa ffeeww CCSSSS ssttyylleess tthhaatt iinncclluuddeedd ccoolloorr lliikkee:: <<pp ssttyyllee==““ccoolloorr:: rreedd;;””>> ►TThheerree aarree aa ffeeww wwaayyss tthhaatt yyoouu ccaann sseett ccoolloorrss iinn CCSSSS:: KKeeyywwoorrddss,, HHeexx vvaalluueess,, RRGGBB,, HHSSLL((aa))
  • 19. CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS ►CCSSSS CCoolloorrss:: KKeeyywwoorrddss ►UUssiinngg tthhee kkeeyywwoorrddss lliikkee:: rreedd,, ffuucchhssiiaa,, yyeellllooww,, bblluuee,, ggrreeeenn yyoouu ccaann ssppeecciiffyy wwhhaatt ccoolloorr yyoouu wwoouulldd lliikkee tthhee CCSSSS rruullee ttoo ddiissppllaayy.. ►FFoorr eexxaammppllee:: ►pp{{ccoolloorr::rreedd}} ►hh22{{ccoolloorr::yyeellllooww}} ►TThheerree aarree 1177 ooff tthheessee kkeeyywwoorrdd ccoolloorrss yyoouu ccaann uussee iinn CCSSSS..
  • 20. CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS KKeeyywwoorrdd CCoolloorr HHeexx aqua #00ffff black #000000 blue #0000ff fuchsia #ff00ff gray #808080 green #008000 lime #00ff00 maroon #800000 navy #000080 olive #808000 orange (added in CSS 2.1) #ffa500 purple #800080 red #ff0000 silver #c0c0c0 teal #008080 white #ffffff yellow #ffff00
  • 21. CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS ►Computers are ccaappaabbllee ooff ddiissppllaayyiinngg aa lloott mmoorree tthhaann 1177 ccoolloorrss.. ►IInn ffaacctt tthheeyy ccaann ddiissppllaayy aapppprrooxxiimmaatteellyy 1166..77 mmiilllliioonn ccoolloorrss!! ►HHeexx VVaalluueess ((hheexx iiss sshhoorrtt ffoorr hheexxaaddeecciimmaall)) aarree tthhee mmoosstt ccoommmmoonn wwaayy ooff ssppeecciiffyyiinngg ccoolloorrss ffoorr wweebb ppaaggeess.. ((sseeee hheexx## iinn tthhee pprreevviioouuss cchhaarrtt)) ►FFoorr eexxaammppllee:: pp{{ccoolloorr:: ##000000000000;;}} //**TThhiiss iiss eeqquuiivvaalleenntt ttoo tthhee kkeeyywwoorrdd bbllaacckk**//
  • 22. CCoolloorrss aanndd FFoorrmmaattttiinngg iinn CCSSSS ►HHeexx nnuummbbeerrss -- hhaass 1166 ppoossssiibbllee vvaalluueess ►00 ttoo 99 tthheenn AA ttoo FF.. WWhhiicchh ggiivveess yyoouu 1166 vvaalluueess.. ►RRGGBB ((RReedd GGrreeeenn BBlluuee)) hhaass tthhee ppoossssiibbiilliittyy ooff 225566 ccoolloorrss ffoorr eeaacchh ((1166xx1166)) ►((RR))225566 xx ((GG))225566 xx ((BB))225566 = 1166,,777777,,221166 oorr 1166..77 mmiilllliioonn ccoolloorr vvaalluueess ►CCSSSS eexxaammppllee:: hh11{{ccoolloorr:: ##000000000000;;}}