SlideShare a Scribd company logo
1 of 20
Web Authoring

     Topic 14 –
Cascading Style Sheets
Objectives
Students should able to:
1   Explain Cascading Style Sheets.
2   Identify the basic syntax and use
    Cascading Style Sheets.
     ATTRIBUTE NAME and VALUE pair(s)
          <STYLE> Tag
     <LINK> Tag
          <LINK REL >
3   Use Cascading Style Sheets to
    create two or more HTML pages
Cascading Style Sheet
Gives complete control over the layout of
the Web page and the appearance of its
content.

You only need to specify presentational
preferences once, and the style can be
applied to an entire site.
Advantages of CSS
The presentation of an entire website can be
updated at a moment’s notice - standardising
the look and feel of a website.
Users of a website can compose style sheets
of their own.
Browsers are beginning to support multiple
style sheets.
Advantages of CSS
Style sheets allow content to be optimized for
more than one type of device.
Style sheets download much more quickly
because web documents using CSS take up
less hard disk space and consume less
bandwidth.
CSS Rules
A style sheet can be broken down into
progressively smaller bits. From large to
small, it goes like this:
       • Style sheet
       • Rule
       • Selector
       • Declaration
       • Property
       • Value
CSS Rules
Rule:-begins with a selector, followed by a
left curly brace, “{“ and ends with a right
curly brace “}”.
       body {
             margin: 0;
             padding: 0;
             background: #000
       url(‘images/backgrounds/earth.jpg) no-
       repeat fixed;
             font: 12 px sans-serif;
       }
CSS Rules
Selectors:- is the HTML element or elements to
which a CSS rule is applied (what to format).
       body {
             margin: 0;
             padding: 0;
             background: #000
       url(‘images/backgrounds/earth.jpg) no-
       repeat fixed;
             font: 12 px sans-serif;
       }
CSS Rules
Declarations:- is the combination of a CSS
property and value.
       body {
             margin: 0;
             padding: 0;
             background: #000
       url(‘images/backgrounds/earth.jpg) no-
       repeat fixed;
             font: 12 px sans-serif;
       }
CSS Rules
Declarations:- is the combination of a CSS
property and value.

The property appears before the colon,
and the colon is used to separate the
property from the value.
CSS Rules
Values:- keyword value is used to invoke a
predefined function.
      body {
             margin: 0;
             padding: 0;
             background: #000
      url(‘images/backgrounds/earth.jpg) no-
      repeat fixed;
             font: 12 px sans-serif;
      }
CSS Rules
Values:- keyword value is used to invoke a
predefined function.           Cont’d
      a{
           text-decoration: none;
           color: lightblue;
      }
CSS Rules
Values:- keyword value is used to invoke a
predefined function.           Cont’d
 The keywords are no-repeat, fixed and light
 blue.
 No-repeat and fixed provide the browser
 with instructions for how to render the
 background image.
 Light blue is a keyword that tells the
 browser what color the text of hyperlinks
 should be.
Basic Syntax of CSS
A CSS rule consists of two main parts:
selecter ('H1') and declaration ('color:
blue').
Cascading Style Sheet
Two ways to specify cascading style rules.

1. Within the HTML document –
             use <STYLE> tag

2. Via an external style sheet document -
             use <LINK> tag
Using <style> Tag
The <STYLE> tag is always inside the
header of the document, i.e. between the
<HEAD> Start and End Tags.

<HEAD>
    <TITLE>Bach's home page</TITLE>
    <STYLE type="text/css">
         H1 { color: blue }
    </STYLE>
</HEAD>
Using <link> Tag
The <LINK> tag is used to access an
External Style Sheet that is contained in
another document. The Attributes REL
and TYPE are required.

<LINK> tag should be placed in the
HEAD section of the document. <STYLE>
tag is not required in external style sheet.
Using <link> Tag
<HTML>
<HEAD>
    <TITLE>Bach's home page</TITLE>
    <LINK rel="stylesheet" href="styles.css"
                 type="text/css">
</HEAD>
<BODY>
    <H1>Bach's home page</H1>
    <P>Johann Sebastian Bach was a prolific
composer.
</BODY>
</HTML>
    In styles.css document
           H1 { color: blue }
Using <link> Tag
    <LINK rel="stylesheet" href="styles.css"
              type="text/css">


Specifies the relationship between the
current document and the linked
document
Referenced to the external file called
styles.css
CSS File
An example of a CSS file – mystyle.css
body
{
       background:brown
}
h1
{
       color:blue;
       font-size:x-large
}

More Related Content

What's hot

What's hot (17)

CSS LAY OUT
CSS LAY OUTCSS LAY OUT
CSS LAY OUT
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
PHP - Introduction to PHP CSS
PHP -  Introduction to PHP CSSPHP -  Introduction to PHP CSS
PHP - Introduction to PHP CSS
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Session v(css)
Session v(css)Session v(css)
Session v(css)
 
Web topic 16 css workflow
Web topic 16  css workflowWeb topic 16  css workflow
Web topic 16 css workflow
 
Css inclusion
Css   inclusionCss   inclusion
Css inclusion
 
CSS
CSSCSS
CSS
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Unit iii css and javascript 1
Unit iii css and javascript 1Unit iii css and javascript 1
Unit iii css and javascript 1
 
Session 2 intro to Css
Session 2 intro to CssSession 2 intro to Css
Session 2 intro to Css
 
Themes
ThemesThemes
Themes
 
CSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorCSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and Color
 
Website design 2
Website design 2Website design 2
Website design 2
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
css
csscss
css
 

Viewers also liked

Web topic 25 mobile optimized website
Web topic 25  mobile optimized websiteWeb topic 25  mobile optimized website
Web topic 25 mobile optimized websiteCK Yang
 
Web topic 24 usage of web browser
Web topic 24  usage of web browserWeb topic 24  usage of web browser
Web topic 24 usage of web browserCK Yang
 
Web topic 32 validate web contents
Web topic 32  validate web contentsWeb topic 32  validate web contents
Web topic 32 validate web contentsCK Yang
 
Web topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelinesWeb topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelinesCK Yang
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validationCK Yang
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validationCK Yang
 
Web topic 23 web accessibility
Web topic 23  web accessibilityWeb topic 23  web accessibility
Web topic 23 web accessibilityCK Yang
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layoutCK Yang
 
Web topic 30 ensure web contents meet
Web topic 30   ensure web contents meetWeb topic 30   ensure web contents meet
Web topic 30 ensure web contents meetCK Yang
 
Web topic 26 browser compatibilty and security
Web topic 26  browser compatibilty and securityWeb topic 26  browser compatibilty and security
Web topic 26 browser compatibilty and securityCK Yang
 
Web topic 33 publish websites
Web topic 33  publish websitesWeb topic 33  publish websites
Web topic 33 publish websitesCK Yang
 
Web topic 31 setup remote site
Web topic 31  setup remote siteWeb topic 31  setup remote site
Web topic 31 setup remote siteCK Yang
 
Web topic 27 class test
Web topic 27  class testWeb topic 27  class test
Web topic 27 class testCK Yang
 
Web topic 15 2 basic css layout
Web topic 15 2  basic css layoutWeb topic 15 2  basic css layout
Web topic 15 2 basic css layoutCK Yang
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html formsCK Yang
 
Web topic 22 validation on web forms
Web topic 22  validation on web formsWeb topic 22  validation on web forms
Web topic 22 validation on web formsCK Yang
 
Web topic 21 pass info via javascript
Web topic 21  pass info via javascriptWeb topic 21  pass info via javascript
Web topic 21 pass info via javascriptCK Yang
 
Web topic 17 font family in css
Web topic 17  font family in cssWeb topic 17  font family in css
Web topic 17 font family in cssCK Yang
 
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 cssCK Yang
 
Web topic 5 text formatting
Web topic 5  text formattingWeb topic 5  text formatting
Web topic 5 text formattingCK Yang
 

Viewers also liked (20)

Web topic 25 mobile optimized website
Web topic 25  mobile optimized websiteWeb topic 25  mobile optimized website
Web topic 25 mobile optimized website
 
Web topic 24 usage of web browser
Web topic 24  usage of web browserWeb topic 24  usage of web browser
Web topic 24 usage of web browser
 
Web topic 32 validate web contents
Web topic 32  validate web contentsWeb topic 32  validate web contents
Web topic 32 validate web contents
 
Web topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelinesWeb topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelines
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validation
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validation
 
Web topic 23 web accessibility
Web topic 23  web accessibilityWeb topic 23  web accessibility
Web topic 23 web accessibility
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
 
Web topic 30 ensure web contents meet
Web topic 30   ensure web contents meetWeb topic 30   ensure web contents meet
Web topic 30 ensure web contents meet
 
Web topic 26 browser compatibilty and security
Web topic 26  browser compatibilty and securityWeb topic 26  browser compatibilty and security
Web topic 26 browser compatibilty and security
 
Web topic 33 publish websites
Web topic 33  publish websitesWeb topic 33  publish websites
Web topic 33 publish websites
 
Web topic 31 setup remote site
Web topic 31  setup remote siteWeb topic 31  setup remote site
Web topic 31 setup remote site
 
Web topic 27 class test
Web topic 27  class testWeb topic 27  class test
Web topic 27 class test
 
Web topic 15 2 basic css layout
Web topic 15 2  basic css layoutWeb topic 15 2  basic css layout
Web topic 15 2 basic css layout
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html forms
 
Web topic 22 validation on web forms
Web topic 22  validation on web formsWeb topic 22  validation on web forms
Web topic 22 validation on web forms
 
Web topic 21 pass info via javascript
Web topic 21  pass info via javascriptWeb topic 21  pass info via javascript
Web topic 21 pass info via javascript
 
Web topic 17 font family in css
Web topic 17  font family in cssWeb topic 17  font family in css
Web topic 17 font family in css
 
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
 
Web topic 5 text formatting
Web topic 5  text formattingWeb topic 5  text formatting
Web topic 5 text formatting
 

Similar to Web topic 14 cascading style sheets

Similar to Web topic 14 cascading style sheets (20)

html-css
html-csshtml-css
html-css
 
Css
CssCss
Css
 
css1.ppt
css1.pptcss1.ppt
css1.ppt
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Css basic
Css basicCss basic
Css basic
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
 
WT CSS
WT  CSSWT  CSS
WT CSS
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Css ppt
Css pptCss ppt
Css ppt
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 

More from CK Yang

Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html formsCK Yang
 
Web topic 13 html validation tools
Web topic 13  html validation toolsWeb topic 13  html validation tools
Web topic 13 html validation toolsCK Yang
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in htmlCK Yang
 
Web topic 11 importance of html validation
Web topic 11  importance of html validationWeb topic 11  importance of html validation
Web topic 11 importance of html validationCK Yang
 
Web topic 10 2 web design basics
Web topic 10 2  web design basicsWeb topic 10 2  web design basics
Web topic 10 2 web design basicsCK Yang
 
Web topic 9 navigation and link
Web topic 9  navigation and linkWeb topic 9  navigation and link
Web topic 9 navigation and linkCK Yang
 
Web topic 8 listings in html
Web topic 8  listings in htmlWeb topic 8  listings in html
Web topic 8 listings in htmlCK Yang
 
Web topic 7 html tags for links
Web topic 7  html tags for linksWeb topic 7  html tags for links
Web topic 7 html tags for linksCK Yang
 
Web topic 4 style in html
Web topic 4  style in htmlWeb topic 4  style in html
Web topic 4 style in htmlCK Yang
 

More from CK Yang (9)

Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html forms
 
Web topic 13 html validation tools
Web topic 13  html validation toolsWeb topic 13  html validation tools
Web topic 13 html validation tools
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in html
 
Web topic 11 importance of html validation
Web topic 11  importance of html validationWeb topic 11  importance of html validation
Web topic 11 importance of html validation
 
Web topic 10 2 web design basics
Web topic 10 2  web design basicsWeb topic 10 2  web design basics
Web topic 10 2 web design basics
 
Web topic 9 navigation and link
Web topic 9  navigation and linkWeb topic 9  navigation and link
Web topic 9 navigation and link
 
Web topic 8 listings in html
Web topic 8  listings in htmlWeb topic 8  listings in html
Web topic 8 listings in html
 
Web topic 7 html tags for links
Web topic 7  html tags for linksWeb topic 7  html tags for links
Web topic 7 html tags for links
 
Web topic 4 style in html
Web topic 4  style in htmlWeb topic 4  style in html
Web topic 4 style in html
 

Recently uploaded

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Recently uploaded (20)

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Web topic 14 cascading style sheets

  • 1. Web Authoring Topic 14 – Cascading Style Sheets
  • 2. Objectives Students should able to: 1 Explain Cascading Style Sheets. 2 Identify the basic syntax and use Cascading Style Sheets. ATTRIBUTE NAME and VALUE pair(s) <STYLE> Tag <LINK> Tag <LINK REL > 3 Use Cascading Style Sheets to create two or more HTML pages
  • 3. Cascading Style Sheet Gives complete control over the layout of the Web page and the appearance of its content. You only need to specify presentational preferences once, and the style can be applied to an entire site.
  • 4. Advantages of CSS The presentation of an entire website can be updated at a moment’s notice - standardising the look and feel of a website. Users of a website can compose style sheets of their own. Browsers are beginning to support multiple style sheets.
  • 5. Advantages of CSS Style sheets allow content to be optimized for more than one type of device. Style sheets download much more quickly because web documents using CSS take up less hard disk space and consume less bandwidth.
  • 6. CSS Rules A style sheet can be broken down into progressively smaller bits. From large to small, it goes like this: • Style sheet • Rule • Selector • Declaration • Property • Value
  • 7. CSS Rules Rule:-begins with a selector, followed by a left curly brace, “{“ and ends with a right curly brace “}”. body { margin: 0; padding: 0; background: #000 url(‘images/backgrounds/earth.jpg) no- repeat fixed; font: 12 px sans-serif; }
  • 8. CSS Rules Selectors:- is the HTML element or elements to which a CSS rule is applied (what to format). body { margin: 0; padding: 0; background: #000 url(‘images/backgrounds/earth.jpg) no- repeat fixed; font: 12 px sans-serif; }
  • 9. CSS Rules Declarations:- is the combination of a CSS property and value. body { margin: 0; padding: 0; background: #000 url(‘images/backgrounds/earth.jpg) no- repeat fixed; font: 12 px sans-serif; }
  • 10. CSS Rules Declarations:- is the combination of a CSS property and value. The property appears before the colon, and the colon is used to separate the property from the value.
  • 11. CSS Rules Values:- keyword value is used to invoke a predefined function. body { margin: 0; padding: 0; background: #000 url(‘images/backgrounds/earth.jpg) no- repeat fixed; font: 12 px sans-serif; }
  • 12. CSS Rules Values:- keyword value is used to invoke a predefined function. Cont’d a{ text-decoration: none; color: lightblue; }
  • 13. CSS Rules Values:- keyword value is used to invoke a predefined function. Cont’d The keywords are no-repeat, fixed and light blue. No-repeat and fixed provide the browser with instructions for how to render the background image. Light blue is a keyword that tells the browser what color the text of hyperlinks should be.
  • 14. Basic Syntax of CSS A CSS rule consists of two main parts: selecter ('H1') and declaration ('color: blue').
  • 15. Cascading Style Sheet Two ways to specify cascading style rules. 1. Within the HTML document – use <STYLE> tag 2. Via an external style sheet document - use <LINK> tag
  • 16. Using <style> Tag The <STYLE> tag is always inside the header of the document, i.e. between the <HEAD> Start and End Tags. <HEAD> <TITLE>Bach's home page</TITLE> <STYLE type="text/css"> H1 { color: blue } </STYLE> </HEAD>
  • 17. Using <link> Tag The <LINK> tag is used to access an External Style Sheet that is contained in another document. The Attributes REL and TYPE are required. <LINK> tag should be placed in the HEAD section of the document. <STYLE> tag is not required in external style sheet.
  • 18. Using <link> Tag <HTML> <HEAD> <TITLE>Bach's home page</TITLE> <LINK rel="stylesheet" href="styles.css" type="text/css"> </HEAD> <BODY> <H1>Bach's home page</H1> <P>Johann Sebastian Bach was a prolific composer. </BODY> </HTML> In styles.css document H1 { color: blue }
  • 19. Using <link> Tag <LINK rel="stylesheet" href="styles.css" type="text/css"> Specifies the relationship between the current document and the linked document Referenced to the external file called styles.css
  • 20. CSS File An example of a CSS file – mystyle.css body { background:brown } h1 { color:blue; font-size:x-large }