SlideShare uma empresa Scribd logo
1 de 40
CSS is a style sheet language used to describe the
presentation semantics (the look and formatting) of a
document written in a markup language. Its most
common application is to style web pages written in
HTML and XHTML, but the language can also be applied
to any kind of XML document, including SVG and XUL.
Single style sheet to multiple
documents
Structure of a Style (CSS)
 CSS
     Selector
     Property
     value

     selector { property : value }
CSS
 selector1 { property1 : value1 }
 selector2 { property2 : value2; property3 : value3 }
CSS Units
 Relative Length (
    px (pixels,
       px, 4px
    em (emphasize,
                 font             body
        font body                  px
    h1{fon-size:1.5em} h1                          px =
     15px
    h2{fon-size:1.4em} h2                          px =
     14px
                            em                px

   ex (x-height,                        x")   ex, 2ex
CSS Units
 Absolute Length (
    in (inches; 1in=2.54cm =72pt =6pc)          in, 1.5in
    cm (centimeters; 1cm=10mm)            cm, 1.11cm
    mm (millimeters)           mm, 0.8mm
    pt (points; 1pt=1/72in, 10pt                    px)
                                     pt, 20pt
    pc (picas; 1pc=12pt)       pc, 2pc
selector { property : value }
 Selector
    HTML Tags
    Class Name
 Property
    Property Name
 value
        Value)      Property
Selector
 Selector
    HTML Tags
    Class Name
Example
[HTML Tags:Style] H2{ background-color : #191970 }
[HTML Tags:Style] P{ text-indent: 3em }
[Class Name:Style] .note { font-size : small }
[Class Name:Style] .normal{ color : blue }
[Class Name:Style] .special{ color : red }
Property
 Property
  
            Property    Selector     Property

 Example
   P { text-indent: 3em }
   H2{ background-color : #191970;
       color : red }
Value
 Value
                            Property
  


     property
  
 Example
   P{ font-family: "sans serif" }
   H1{font-family: Verdana,"sans serif”; color : red}
Groups Selector
 Example
    H1,H2,H3,H4,H5,H6 { color: green }
    H1,H2,H6 { color: red }
    body,H1,H2,H6 { color: red }
    Body.opt1,H1 { color: red }
Class Selector
 Example (CSS Style)
    <p>
    p.right { text-align: right }
    p.center { text-align: center}
 In HTML Files
    <p class="right">This paragraph will be right-
     aligned.</p>
    <p class="center">This paragraph will be center-
     aligned.</p>
Class Selector : Non Tags
 Example (CSS Style)
   
    .center { text-align: center }
 In HTML Files
    <h1 class="center">This heading will be center-
     aligned</h1>
    <p class="center">This paragraph will also be center-
     aligned.</p>
ID Selector
 ID Selector
    ID Selector
        Class Selector                 Style

 Example
    #wer345{ text-align: center; color: green}
    h1#wer345{ text-align: center; color : red }
 In HTML Files
    <h1 id="wer345">Heading</h1>
    <p id="wer345">Some text</p>
Comment
 Example
   p { text-align: center; /* This is a comment */ }
Style: Style Sheet
Style: Style Sheet
Syntax
  Write styles for any element
      selector {property: value;}
  External Style Sheet
      <link rel="stylesheet" type="text/css" href="style.css" />
  Internal Style
      <style type=”text/css”>selector {property: value}</style>
  Inline Style
      <tag style=”property: value”>
Style: Style Sheet
Style
  Inline Style(In line HTML Tags)
  Internal Style Sheet(In HTML head Tags)
  External Style Sheet(NameStyleSheet.css)
Inline Style
 Example
    <H2 style= “background-color: blue; color: white”>
     Heading 2 </H2>
    <P style= “font-size: 20pt”> This text has the <EM>
     font-size </EM> style applied to it. </P>
    <P style= “font-size: 20pt; color: #ff0000”>font-size 20
     pt and red color. </P>
Internal Style
Example
<html><head>
  <style type="text/css">
     BODY{background-image: url("bgpic.jpg")}
     EM{background-color: #8000ff;color: white}
     H1{font-family: arial, sans-serif }
     P{font-size: 14pt}
     .special{color: blue}
     .special{color: blue}
  </style>
</head><body>...</body></html>
Internal Style
Example
<html><head>…</head><body>
<H1 class = "special"> MAN and MEN</H1>
<P> The exalted origin of the word
<EM>MAN </EM> is clear int the plural form,
<EM> men </EM>, from <B>mental </B>. It is inspiring to note
that man was so named because he was
<EM> the one that thinks </EM>.</P>
<H1> The Thinker </H1>
<P class = "special"> If you have ever seen a copy – the original is in
Paris – of the famous sculpture by Auguste Rodin called
<EM> The Thinker </EM>, you would agree that the essential
nature of man stems from his ability to think.</P>
</body></html>
External Style
 <html><head>
 <link rel = "stylesheet" type = "text/css" href =
  "styles.css"/>
 </head><body>...</body></html>
External Style
                       css
     /* An External Style Sheet */
     BODY { background-image : url("images/bgpic.jpg") }
     EM { background-color : #8000ff; color : white }
     H1 { font-family : arial, sans-serif }
     H2 { background-color : blue; color : white }
     P{ font-size : 14pt }
     UL { margin-left: 2cm }
     .special{ color : blue; font-weight : bold }
     .normal{ color : red }
1) Inline Style
2) Internal Style Sheet
3) External Style Sheet
4)       Style
                      Browser
     Default)
            Inline Style       Style

            Inline Style
               Inline Style        Internal
    Style
              Internal Style           External
    Style
                           Style
       Style
 Selector              Property
           Property
        Property

    inherit)
               Style
/*An external stylesheet*/            :
 h3 { color: red; text-align:     <link rel="stylesheet"
left; font-size: 8pt }          type="text/css"
                                href="hstyles.css">
                                <style type = "text/css">
                                h3 {text-align: right; font-
                                size: 20pt}
                                  </style>
                                     :
Property H3 Tag
 Property               h3>
   color: red”
   “text-align: right;”
   “font-size: 20pt”
CSS
 Example
<html><head>
<style type="text/css">
p,table,h1,h2,h3 {font-family: verdana, arial, “sans serif”; }
p,h1,h2,h3,table,hr{ margin-left: 10pt }
p,th,td{ font-size: 75% }
body{ #ffffff }
h1,h2,h3,hr { color: firebrick }
</style>
</head><body>…</body></html>
CSS
 Example
<html><head>…</head><body>
<h1>This is header 1</h1> <hr>
<p>This is a paragraph</p>
<p>This is another paragraph</p> <hr>
<h2>This is header 2, followed by a table</h2>
<table border="1" width="100%">
<tr>     <th>First Name</th><th>Name</th>
         <th>Telephone</th> <th>Fax</th> </tr>
<tr>     <td>Hege</td> <td>Svendson</td>
         <td>555-777-0001</td>
         <td>555-777-0000</td> </tr>
<tr>     <td>Kai Jim</td> <td>Svendson</td>
         <td>555-777-0002</td> <td>&nbsp;</td> </tr> </table>
</body></html>
CSS
CSS
 Example
<html><head>
<style type="text/css">
h1,h2,h3 { font-family: arial, “sans serif” }
p,table,li,address {
                margin-left: 15pt;
                font-family: arial, “sans serif” }
 p, th,td { font-size: 80% }
 th             { background-color:#FAEBD7}
 body { background-color: #ffffff }
 h1,h2,h3,hr { color:saddlebrown }
</style>
</head><body>…</body></html>
CSS
Formatting Hypertext Links
To remove the style of underlining hypertext,
use:
 A {text-decoration:none}
Formatting Hypertext Links
4 types of hyperlinks can be modified:
 A:visited {styles for previously visited links}
 A:link {styles for links that have never
  visited}
 A:active {styles for links that are currently
  being clicked}
 A:hover {styles when the mouse cursor is
  hovering over the link}
Ref.
 http://www.w3.org/
 http://www.w3shcools.com/
 http://www.westciv.com/style_master/academy/css_t
  utorial/
 H.M Deitel, P.J. Deitel, T.R. Nieto, (2002), Internet &
  World Wide Web How to Program, Prentice Hall.

Mais conteúdo relacionado

Mais procurados (20)

Html 2
Html   2Html   2
Html 2
 
Html
HtmlHtml
Html
 
Unit 2 (it workshop)
Unit 2 (it workshop)Unit 2 (it workshop)
Unit 2 (it workshop)
 
The Ring programming language version 1.4 book - Part 13 of 30
The Ring programming language version 1.4 book - Part 13 of 30The Ring programming language version 1.4 book - Part 13 of 30
The Ring programming language version 1.4 book - Part 13 of 30
 
Hypertext markup language(html)
Hypertext markup language(html)Hypertext markup language(html)
Hypertext markup language(html)
 
Web Technology Lab File
Web Technology Lab FileWeb Technology Lab File
Web Technology Lab File
 
HTML Tutorials
HTML TutorialsHTML Tutorials
HTML Tutorials
 
Hypertext_markup_language
Hypertext_markup_languageHypertext_markup_language
Hypertext_markup_language
 
CSS Part II
CSS Part IICSS Part II
CSS Part II
 
Html tables examples
Html tables   examplesHtml tables   examples
Html tables examples
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
Postlet June1709
Postlet June1709Postlet June1709
Postlet June1709
 
Practical file(XHTML)web designing
Practical file(XHTML)web designingPractical file(XHTML)web designing
Practical file(XHTML)web designing
 
TYBSC prac soln
TYBSC prac solnTYBSC prac soln
TYBSC prac soln
 
CSS
CSSCSS
CSS
 
Ict 8 css
Ict 8 cssIct 8 css
Ict 8 css
 
Css(handbook)
Css(handbook)Css(handbook)
Css(handbook)
 
Css1
Css1Css1
Css1
 

Destaque

REVISTA PEDAGOGIA 3ER MILENIO
REVISTA PEDAGOGIA 3ER MILENIOREVISTA PEDAGOGIA 3ER MILENIO
REVISTA PEDAGOGIA 3ER MILENIOMARIAETM
 
Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...
Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...
Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...Jordano Santos Cerqueira
 
ชีววิทยา1
ชีววิทยา1ชีววิทยา1
ชีววิทยา1Darika Kanhala
 
Warp 8 cloud solution_ppt
Warp 8 cloud solution_pptWarp 8 cloud solution_ppt
Warp 8 cloud solution_pptchasjs
 
Frios e congelados
Frios e congeladosFrios e congelados
Frios e congeladosgentedagente
 
HSK Level 4 H41001
HSK Level 4 H41001HSK Level 4 H41001
HSK Level 4 H41001Hoa Vu
 
The song of_the_bird_sas
The song of_the_bird_sasThe song of_the_bird_sas
The song of_the_bird_sasGautam Shah
 
The West Midlands Research Collaborative
The West Midlands Research CollaborativeThe West Midlands Research Collaborative
The West Midlands Research Collaborativejimmystrein
 
Informational text and the inquiry process2
Informational text and the inquiry process2Informational text and the inquiry process2
Informational text and the inquiry process2bdobler2
 
Lectura 1,electiva iii, clase 03 08-11
Lectura 1,electiva iii, clase 03 08-11Lectura 1,electiva iii, clase 03 08-11
Lectura 1,electiva iii, clase 03 08-11JULIANARDILAQUIASUA
 
H24年度「創成研究」インターンシップpr用
H24年度「創成研究」インターンシップpr用H24年度「創成研究」インターンシップpr用
H24年度「創成研究」インターンシップpr用knzwuniv
 
What i did last summer
What i did last summerWhat i did last summer
What i did last summerLadyDorrit
 
Cloud 2010
Cloud 2010Cloud 2010
Cloud 2010steccami
 
iiwas 2010
iiwas 2010iiwas 2010
iiwas 2010steccami
 

Destaque (20)

Biotech Bulletin 2Q2015
Biotech Bulletin 2Q2015Biotech Bulletin 2Q2015
Biotech Bulletin 2Q2015
 
Tema 3
Tema 3Tema 3
Tema 3
 
REVISTA PEDAGOGIA 3ER MILENIO
REVISTA PEDAGOGIA 3ER MILENIOREVISTA PEDAGOGIA 3ER MILENIO
REVISTA PEDAGOGIA 3ER MILENIO
 
nascar overview - 04/2011
nascar overview - 04/2011nascar overview - 04/2011
nascar overview - 04/2011
 
test test
test testtest test
test test
 
Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...
Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...
Eleições 2016 - Linhares - Faceli - DCE (Diretório Centra dos Estudantes) - P...
 
ชีววิทยา1
ชีววิทยา1ชีววิทยา1
ชีววิทยา1
 
Warp 8 cloud solution_ppt
Warp 8 cloud solution_pptWarp 8 cloud solution_ppt
Warp 8 cloud solution_ppt
 
Food
FoodFood
Food
 
Frios e congelados
Frios e congeladosFrios e congelados
Frios e congelados
 
HSK Level 4 H41001
HSK Level 4 H41001HSK Level 4 H41001
HSK Level 4 H41001
 
The song of_the_bird_sas
The song of_the_bird_sasThe song of_the_bird_sas
The song of_the_bird_sas
 
The West Midlands Research Collaborative
The West Midlands Research CollaborativeThe West Midlands Research Collaborative
The West Midlands Research Collaborative
 
Informational text and the inquiry process2
Informational text and the inquiry process2Informational text and the inquiry process2
Informational text and the inquiry process2
 
Lectura 1,electiva iii, clase 03 08-11
Lectura 1,electiva iii, clase 03 08-11Lectura 1,electiva iii, clase 03 08-11
Lectura 1,electiva iii, clase 03 08-11
 
H24年度「創成研究」インターンシップpr用
H24年度「創成研究」インターンシップpr用H24年度「創成研究」インターンシップpr用
H24年度「創成研究」インターンシップpr用
 
Hearing aid-batteries-toronto
Hearing aid-batteries-torontoHearing aid-batteries-toronto
Hearing aid-batteries-toronto
 
What i did last summer
What i did last summerWhat i did last summer
What i did last summer
 
Cloud 2010
Cloud 2010Cloud 2010
Cloud 2010
 
iiwas 2010
iiwas 2010iiwas 2010
iiwas 2010
 

Semelhante a html (20)

Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
Css1
Css1Css1
Css1
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Css 1
Css 1Css 1
Css 1
 
Css tutorial
Css tutorialCss tutorial
Css tutorial
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
css-ppt.pdf
css-ppt.pdfcss-ppt.pdf
css-ppt.pdf
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
CSS notes
CSS notesCSS notes
CSS notes
 
css-note.pptx
css-note.pptxcss-note.pptx
css-note.pptx
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Estilos Css
Estilos CssEstilos Css
Estilos Css
 
CSS
CSSCSS
CSS
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 

Último

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
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.pdfAdmir Softic
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
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...christianmathematics
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
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 . pdfQucHHunhnh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
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).pptxVishalSingh1417
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
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 Delhikauryashika82
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Último (20)

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
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
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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...
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
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
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
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
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
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
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

html

  • 1. CSS is a style sheet language used to describe the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including SVG and XUL.
  • 2. Single style sheet to multiple documents
  • 3.
  • 4. Structure of a Style (CSS)  CSS  Selector  Property  value   selector { property : value }
  • 5. CSS  selector1 { property1 : value1 }  selector2 { property2 : value2; property3 : value3 }
  • 6. CSS Units  Relative Length (  px (pixels, px, 4px  em (emphasize, font body  font body px  h1{fon-size:1.5em} h1 px = 15px  h2{fon-size:1.4em} h2 px = 14px  em px  ex (x-height, x") ex, 2ex
  • 7. CSS Units  Absolute Length (  in (inches; 1in=2.54cm =72pt =6pc) in, 1.5in  cm (centimeters; 1cm=10mm) cm, 1.11cm  mm (millimeters) mm, 0.8mm  pt (points; 1pt=1/72in, 10pt px) pt, 20pt  pc (picas; 1pc=12pt) pc, 2pc
  • 8. selector { property : value }  Selector  HTML Tags  Class Name  Property  Property Name  value  Value) Property
  • 9. Selector  Selector  HTML Tags  Class Name Example [HTML Tags:Style] H2{ background-color : #191970 } [HTML Tags:Style] P{ text-indent: 3em } [Class Name:Style] .note { font-size : small } [Class Name:Style] .normal{ color : blue } [Class Name:Style] .special{ color : red }
  • 10. Property  Property   Property Selector Property  Example  P { text-indent: 3em }  H2{ background-color : #191970; color : red }
  • 11. Value  Value  Property   property   Example  P{ font-family: "sans serif" }  H1{font-family: Verdana,"sans serif”; color : red}
  • 12. Groups Selector  Example  H1,H2,H3,H4,H5,H6 { color: green }  H1,H2,H6 { color: red }  body,H1,H2,H6 { color: red }  Body.opt1,H1 { color: red }
  • 13. Class Selector  Example (CSS Style)  <p>  p.right { text-align: right }  p.center { text-align: center}  In HTML Files  <p class="right">This paragraph will be right- aligned.</p>  <p class="center">This paragraph will be center- aligned.</p>
  • 14. Class Selector : Non Tags  Example (CSS Style)   .center { text-align: center }  In HTML Files  <h1 class="center">This heading will be center- aligned</h1>  <p class="center">This paragraph will also be center- aligned.</p>
  • 15. ID Selector  ID Selector  ID Selector  Class Selector Style  Example  #wer345{ text-align: center; color: green}  h1#wer345{ text-align: center; color : red }  In HTML Files  <h1 id="wer345">Heading</h1>  <p id="wer345">Some text</p>
  • 16. Comment  Example  p { text-align: center; /* This is a comment */ }
  • 18. Style: Style Sheet Syntax  Write styles for any element  selector {property: value;}  External Style Sheet  <link rel="stylesheet" type="text/css" href="style.css" />  Internal Style  <style type=”text/css”>selector {property: value}</style>  Inline Style  <tag style=”property: value”>
  • 19. Style: Style Sheet Style  Inline Style(In line HTML Tags)  Internal Style Sheet(In HTML head Tags)  External Style Sheet(NameStyleSheet.css)
  • 20. Inline Style  Example  <H2 style= “background-color: blue; color: white”> Heading 2 </H2>  <P style= “font-size: 20pt”> This text has the <EM> font-size </EM> style applied to it. </P>  <P style= “font-size: 20pt; color: #ff0000”>font-size 20 pt and red color. </P>
  • 21. Internal Style Example <html><head> <style type="text/css"> BODY{background-image: url("bgpic.jpg")} EM{background-color: #8000ff;color: white} H1{font-family: arial, sans-serif } P{font-size: 14pt} .special{color: blue} .special{color: blue} </style> </head><body>...</body></html>
  • 22. Internal Style Example <html><head>…</head><body> <H1 class = "special"> MAN and MEN</H1> <P> The exalted origin of the word <EM>MAN </EM> is clear int the plural form, <EM> men </EM>, from <B>mental </B>. It is inspiring to note that man was so named because he was <EM> the one that thinks </EM>.</P> <H1> The Thinker </H1> <P class = "special"> If you have ever seen a copy – the original is in Paris – of the famous sculpture by Auguste Rodin called <EM> The Thinker </EM>, you would agree that the essential nature of man stems from his ability to think.</P> </body></html>
  • 23. External Style  <html><head>  <link rel = "stylesheet" type = "text/css" href = "styles.css"/>  </head><body>...</body></html>
  • 24. External Style  css  /* An External Style Sheet */  BODY { background-image : url("images/bgpic.jpg") }  EM { background-color : #8000ff; color : white }  H1 { font-family : arial, sans-serif }  H2 { background-color : blue; color : white }  P{ font-size : 14pt }  UL { margin-left: 2cm }  .special{ color : blue; font-weight : bold }  .normal{ color : red }
  • 25.
  • 26. 1) Inline Style 2) Internal Style Sheet 3) External Style Sheet 4) Style Browser Default)
  • 27. Inline Style Style Inline Style  Inline Style Internal Style  Internal Style External Style  Style
  • 28. Style Selector Property Property  Property inherit) Style
  • 29. /*An external stylesheet*/ : h3 { color: red; text-align: <link rel="stylesheet" left; font-size: 8pt } type="text/css" href="hstyles.css"> <style type = "text/css"> h3 {text-align: right; font- size: 20pt} </style> :
  • 30. Property H3 Tag  Property h3>  color: red”  “text-align: right;”  “font-size: 20pt”
  • 31.
  • 32. CSS  Example <html><head> <style type="text/css"> p,table,h1,h2,h3 {font-family: verdana, arial, “sans serif”; } p,h1,h2,h3,table,hr{ margin-left: 10pt } p,th,td{ font-size: 75% } body{ #ffffff } h1,h2,h3,hr { color: firebrick } </style> </head><body>…</body></html>
  • 33. CSS  Example <html><head>…</head><body> <h1>This is header 1</h1> <hr> <p>This is a paragraph</p> <p>This is another paragraph</p> <hr> <h2>This is header 2, followed by a table</h2> <table border="1" width="100%"> <tr> <th>First Name</th><th>Name</th> <th>Telephone</th> <th>Fax</th> </tr> <tr> <td>Hege</td> <td>Svendson</td> <td>555-777-0001</td> <td>555-777-0000</td> </tr> <tr> <td>Kai Jim</td> <td>Svendson</td> <td>555-777-0002</td> <td>&nbsp;</td> </tr> </table> </body></html>
  • 34. CSS
  • 35. CSS  Example <html><head> <style type="text/css"> h1,h2,h3 { font-family: arial, “sans serif” } p,table,li,address { margin-left: 15pt; font-family: arial, “sans serif” } p, th,td { font-size: 80% } th { background-color:#FAEBD7} body { background-color: #ffffff } h1,h2,h3,hr { color:saddlebrown } </style> </head><body>…</body></html>
  • 36. CSS
  • 37.
  • 38. Formatting Hypertext Links To remove the style of underlining hypertext, use:  A {text-decoration:none}
  • 39. Formatting Hypertext Links 4 types of hyperlinks can be modified:  A:visited {styles for previously visited links}  A:link {styles for links that have never visited}  A:active {styles for links that are currently being clicked}  A:hover {styles when the mouse cursor is hovering over the link}
  • 40. Ref.  http://www.w3.org/  http://www.w3shcools.com/  http://www.westciv.com/style_master/academy/css_t utorial/  H.M Deitel, P.J. Deitel, T.R. Nieto, (2002), Internet & World Wide Web How to Program, Prentice Hall.