SlideShare a Scribd company logo
External Style Sheets
External Style Sheets:
   An external style sheet is a separate file with a
    .css extension. It contains only CSS code and
    no XHTML.
   Utilized to maintain consistent styling across
    multiple pages.
   Enables us to make global changes to a website
    from a single file.
   Further separates our page content from our
    page styling.
Linking to an External Style Sheet:
For each XHTML page that will use the styling of
the external CSS file, place a <link> statement in
the <head> section of the document.
  <head>
    <link rel="stylesheet" type="text/css" href="style.css" />
  </head>




               This is the name of the external CSS
                file. If no path is specified, the file
               must reside in the same folder as the
                             XHTML file.
The External CSS File:
style.css:
p {                           The syntax for the external
      color: brown;
                             CSS file is nearly identical to
      font-style: normal;
      font-weight: bold;    an internal style sheet. We do
      font-family: Arial;    not need the <style> element
      font-size: 12px;      or any other introductory code.
}

                              It doesn't matter whether or
h1 {
   text-align:center;
                            not we place a space between
   font-style:italic;       the selector and the property.
   font-weight:bold;         Using spaces does make the
   font-size:24px;             style sheet easier to read.
   font-family:Arial;
}
Adding CSS Comments:
p {                                  Just as we add comments to
      color: brown;
                                     our XHTML code, we can do
      font-style: normal;
      font-weight: bold;           the same with CSS. Everything
      font-family: Arial;             between the opening /* and
      font-size: 12px;              closing */ will be ignored by the
}                                               browser.
/*This main heading will be          CSS comments can be used
   changed to Verdana in June.*/
h1 {
                                   when experimenting with styles.
   text-align: center;                 Instead of deleting style
   font-style: italic;             declarations and then retyping
   font-weight: bold;               them, we can "comment them
   font-size: 24px;
                                      out" temporarily and then
   font-family: Arial;
}
                                      remove the /* and */ later.

More Related Content

What's hot

Web programming css
Web programming cssWeb programming css
Web programming css
Uma mohan
 
Web topic 18 conflict resolution in css
Web topic 18  conflict resolution in cssWeb topic 18  conflict resolution in css
Web topic 18 conflict resolution in css
CK Yang
 

What's hot (20)

An Introduction to CSS
An Introduction to CSSAn Introduction to CSS
An Introduction to CSS
 
Css present
Css presentCss present
Css present
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
 
Css ms megha
Css ms meghaCss ms megha
Css ms megha
 
CSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorCSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and Color
 
Css
CssCss
Css
 
Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
Css1
Css1Css1
Css1
 
Web programming css
Web programming cssWeb programming css
Web programming css
 
Welcome to css!
Welcome to css!Welcome to css!
Welcome to css!
 
Cascading Style Sheet | CSS
Cascading Style Sheet | CSSCascading Style Sheet | CSS
Cascading Style Sheet | CSS
 
Styling of css
Styling of cssStyling of css
Styling of css
 
Cascading Style Sheets - CSS - Tutorial
Cascading Style Sheets - CSS  -  TutorialCascading Style Sheets - CSS  -  Tutorial
Cascading Style Sheets - CSS - Tutorial
 
Css
CssCss
Css
 
N5 CSS
N5 CSSN5 CSS
N5 CSS
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Web topic 18 conflict resolution in css
Web topic 18  conflict resolution in cssWeb topic 18  conflict resolution in css
Web topic 18 conflict resolution in css
 

Viewers also liked

Dress from newspapers_-_copy (1)
Dress from newspapers_-_copy (1)Dress from newspapers_-_copy (1)
Dress from newspapers_-_copy (1)
Eva Vovka
 
Jingle bells power point
Jingle bells power pointJingle bells power point
Jingle bells power point
Martis Flower
 
American Campaign to supress Islam
American Campaign to supress IslamAmerican Campaign to supress Islam
American Campaign to supress Islam
Abu Talha
 
[Gmic]nale be cubbying
[Gmic]nale be cubbying[Gmic]nale be cubbying
[Gmic]nale be cubbying
Hyoin Sung
 
Questionnaire results students-teachers-zr
Questionnaire results students-teachers-zrQuestionnaire results students-teachers-zr
Questionnaire results students-teachers-zr
Mihajlo Gajic
 
You can build anything (Anita Borg 2011)
You can build anything (Anita Borg 2011)You can build anything (Anita Borg 2011)
You can build anything (Anita Borg 2011)
jmcgill_slideshare
 
Ecosystem power point template lesson 2
Ecosystem power point template lesson 2Ecosystem power point template lesson 2
Ecosystem power point template lesson 2
kbarker12
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
Bulldogs83
 
5.2 nesting and floating elements
5.2 nesting and floating elements5.2 nesting and floating elements
5.2 nesting and floating elements
Bulldogs83
 
I save energy
I save energyI save energy
I save energy
Eva Vovka
 
1.3 creating links
1.3 creating links1.3 creating links
1.3 creating links
Bulldogs83
 
Mūžizglītības programmas comenius apkašprogrammas
Mūžizglītības programmas comenius apkašprogrammasMūžizglītības programmas comenius apkašprogrammas
Mūžizglītības programmas comenius apkašprogrammas
Eva Vovka
 

Viewers also liked (20)

CSS
CSS CSS
CSS
 
Dress from newspapers_-_copy (1)
Dress from newspapers_-_copy (1)Dress from newspapers_-_copy (1)
Dress from newspapers_-_copy (1)
 
Jingle bells power point
Jingle bells power pointJingle bells power point
Jingle bells power point
 
Football (2)
Football (2)Football (2)
Football (2)
 
American Campaign to supress Islam
American Campaign to supress IslamAmerican Campaign to supress Islam
American Campaign to supress Islam
 
Ajusal
AjusalAjusal
Ajusal
 
[Gmic]nale be cubbying
[Gmic]nale be cubbying[Gmic]nale be cubbying
[Gmic]nale be cubbying
 
Another world (2)- Aļona
Another world (2)-  AļonaAnother world (2)-  Aļona
Another world (2)- Aļona
 
Power o
Power oPower o
Power o
 
Questionnaire results students-teachers-zr
Questionnaire results students-teachers-zrQuestionnaire results students-teachers-zr
Questionnaire results students-teachers-zr
 
Global warming, presentatation made by Lāsma Akote
Global warming, presentatation made by Lāsma AkoteGlobal warming, presentatation made by Lāsma Akote
Global warming, presentatation made by Lāsma Akote
 
Power u
Power uPower u
Power u
 
You can build anything (Anita Borg 2011)
You can build anything (Anita Borg 2011)You can build anything (Anita Borg 2011)
You can build anything (Anita Borg 2011)
 
Ecosystem power point template lesson 2
Ecosystem power point template lesson 2Ecosystem power point template lesson 2
Ecosystem power point template lesson 2
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
 
5.2 nesting and floating elements
5.2 nesting and floating elements5.2 nesting and floating elements
5.2 nesting and floating elements
 
I save energy
I save energyI save energy
I save energy
 
1.3 creating links
1.3 creating links1.3 creating links
1.3 creating links
 
Power e
Power ePower e
Power e
 
Mūžizglītības programmas comenius apkašprogrammas
Mūžizglītības programmas comenius apkašprogrammasMūžizglītības programmas comenius apkašprogrammas
Mūžizglītības programmas comenius apkašprogrammas
 

Similar to 7.2 external style sheets

Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Paul Dionysius
 
Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Class 2 handout css exercises (2)
Class 2 handout css exercises (2)
Erin M. Kidwell
 
5th Lecture- WEB ENGINEERING basics.pptx
5th Lecture- WEB ENGINEERING basics.pptx5th Lecture- WEB ENGINEERING basics.pptx
5th Lecture- WEB ENGINEERING basics.pptx
Aasma13
 
Web topic 16 css workflow
Web topic 16  css workflowWeb topic 16  css workflow
Web topic 16 css workflow
CK Yang
 

Similar to 7.2 external style sheets (20)

CSS
CSSCSS
CSS
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
CSS Presentation Notes.pptx
CSS Presentation Notes.pptxCSS Presentation Notes.pptx
CSS Presentation Notes.pptx
 
css-ppt.pdf
css-ppt.pdfcss-ppt.pdf
css-ppt.pdf
 
Css Intro by
Css Intro by Css Intro by
Css Intro by
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Class 2 handout css exercises (2)
Class 2 handout css exercises (2)
 
Cascstylesheets
CascstylesheetsCascstylesheets
Cascstylesheets
 
Cascade.ss
Cascade.ssCascade.ss
Cascade.ss
 
Html Css Mistakes
Html Css MistakesHtml Css Mistakes
Html Css Mistakes
 
Make Css easy : easy tips for css
Make Css easy : easy tips for cssMake Css easy : easy tips for css
Make Css easy : easy tips for css
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
 
5th Lecture- WEB ENGINEERING basics.pptx
5th Lecture- WEB ENGINEERING basics.pptx5th Lecture- WEB ENGINEERING basics.pptx
5th Lecture- WEB ENGINEERING basics.pptx
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Web topic 16 css workflow
Web topic 16  css workflowWeb topic 16  css workflow
Web topic 16 css workflow
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 

More from Bulldogs83

7.1 xhtml validation
7.1 xhtml validation7.1 xhtml validation
7.1 xhtml validation
Bulldogs83
 
6.2 css link styling
6.2 css link styling6.2 css link styling
6.2 css link styling
Bulldogs83
 
6.1 special characters
6.1 special characters6.1 special characters
6.1 special characters
Bulldogs83
 
5.1 css box model
5.1 css box model5.1 css box model
5.1 css box model
Bulldogs83
 
4.3 table styling
4.3 table styling4.3 table styling
4.3 table styling
Bulldogs83
 
4.2 css classes
4.2 css classes4.2 css classes
4.2 css classes
Bulldogs83
 
4.1 advanced tables
4.1 advanced tables4.1 advanced tables
4.1 advanced tables
Bulldogs83
 
3.1 xhtml tables
3.1 xhtml tables3.1 xhtml tables
3.1 xhtml tables
Bulldogs83
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
Bulldogs83
 
2.1 adding images
2.1 adding images2.1 adding images
2.1 adding images
Bulldogs83
 
1.4 adding comments copy (2)
1.4 adding comments   copy (2)1.4 adding comments   copy (2)
1.4 adding comments copy (2)
Bulldogs83
 
1.4 adding comments copy (2)
1.4 adding comments   copy (2)1.4 adding comments   copy (2)
1.4 adding comments copy (2)
Bulldogs83
 
1.3 creating links
1.3 creating links1.3 creating links
1.3 creating links
Bulldogs83
 
1.2 elements and attributes copy (3)
1.2 elements and attributes   copy (3)1.2 elements and attributes   copy (3)
1.2 elements and attributes copy (3)
Bulldogs83
 
1.2 elements and attributes copy (3)
1.2 elements and attributes   copy (3)1.2 elements and attributes   copy (3)
1.2 elements and attributes copy (3)
Bulldogs83
 
1.1 xhtml basics
1.1 xhtml basics1.1 xhtml basics
1.1 xhtml basics
Bulldogs83
 

More from Bulldogs83 (16)

7.1 xhtml validation
7.1 xhtml validation7.1 xhtml validation
7.1 xhtml validation
 
6.2 css link styling
6.2 css link styling6.2 css link styling
6.2 css link styling
 
6.1 special characters
6.1 special characters6.1 special characters
6.1 special characters
 
5.1 css box model
5.1 css box model5.1 css box model
5.1 css box model
 
4.3 table styling
4.3 table styling4.3 table styling
4.3 table styling
 
4.2 css classes
4.2 css classes4.2 css classes
4.2 css classes
 
4.1 advanced tables
4.1 advanced tables4.1 advanced tables
4.1 advanced tables
 
3.1 xhtml tables
3.1 xhtml tables3.1 xhtml tables
3.1 xhtml tables
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
 
2.1 adding images
2.1 adding images2.1 adding images
2.1 adding images
 
1.4 adding comments copy (2)
1.4 adding comments   copy (2)1.4 adding comments   copy (2)
1.4 adding comments copy (2)
 
1.4 adding comments copy (2)
1.4 adding comments   copy (2)1.4 adding comments   copy (2)
1.4 adding comments copy (2)
 
1.3 creating links
1.3 creating links1.3 creating links
1.3 creating links
 
1.2 elements and attributes copy (3)
1.2 elements and attributes   copy (3)1.2 elements and attributes   copy (3)
1.2 elements and attributes copy (3)
 
1.2 elements and attributes copy (3)
1.2 elements and attributes   copy (3)1.2 elements and attributes   copy (3)
1.2 elements and attributes copy (3)
 
1.1 xhtml basics
1.1 xhtml basics1.1 xhtml basics
1.1 xhtml basics
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 

Recently uploaded (20)

Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 

7.2 external style sheets

  • 2. External Style Sheets:  An external style sheet is a separate file with a .css extension. It contains only CSS code and no XHTML.  Utilized to maintain consistent styling across multiple pages.  Enables us to make global changes to a website from a single file.  Further separates our page content from our page styling.
  • 3. Linking to an External Style Sheet: For each XHTML page that will use the styling of the external CSS file, place a <link> statement in the <head> section of the document. <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> This is the name of the external CSS file. If no path is specified, the file must reside in the same folder as the XHTML file.
  • 4. The External CSS File: style.css: p { The syntax for the external color: brown; CSS file is nearly identical to font-style: normal; font-weight: bold; an internal style sheet. We do font-family: Arial; not need the <style> element font-size: 12px; or any other introductory code. } It doesn't matter whether or h1 { text-align:center; not we place a space between font-style:italic; the selector and the property. font-weight:bold; Using spaces does make the font-size:24px; style sheet easier to read. font-family:Arial; }
  • 5. Adding CSS Comments: p { Just as we add comments to color: brown; our XHTML code, we can do font-style: normal; font-weight: bold; the same with CSS. Everything font-family: Arial; between the opening /* and font-size: 12px; closing */ will be ignored by the } browser. /*This main heading will be CSS comments can be used changed to Verdana in June.*/ h1 { when experimenting with styles. text-align: center; Instead of deleting style font-style: italic; declarations and then retyping font-weight: bold; them, we can "comment them font-size: 24px; out" temporarily and then font-family: Arial; } remove the /* and */ later.