SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Cascading Style sheetsCascading Style sheets
Cascading Style sheetsCascading Style sheets
 CSS stands for Cascading Style Sheets
 Styles define how to display (X)HTML elements
 Styles are normally stored in Style Sheets
 Multiple style definitions will cascade into one
 Cascading style sheets (CSS) or simply style sheets are text
files that contain one or more with in the form of
property/value pairs to determine in a Web page should be
displayed.
 They were developed with the aim to create the structure,
look and feel of a Web page but the elements present on
the web page are handled separately.
Cascading Style sheetsCascading Style sheets
CSS deals with all the style-related aspects important to
create a web page W3C (world wide web consortium)
has developed some specifications.
Two versions of CSS specification
1. CSS1
2. CSS2.
After the introduction of CSS, HTML elements that
purely deal with style related aspects, such as <u>,
<center>, and <strike> have been deprecated and W3C
has recommended that in place of this HTML element,
their replacements should be use in CSS.
 The syntax of CSS is slightly different from that HTML. In
contrast to the angle brackets (<and>), equal signs, and
quotation marks found in the HTML syntax,
 The CSS syntax contains curly braces, colons, and semicolons.
The syntax of a CSS rule is as follows:
Selector {property1: property1-value; property2: property2-
value; property3: property3-value………………..}
In the preceding syntax, selector is the element that the
rule defines, property1, property2, and property3 are the
properties (attributes) define for that element, and property1-
value, property2-value, and property3-value are values assigned
to these properties. The portion of the syntax enclosed within
the curly braces is termed as declaration.
Cascading Style sheetsCascading Style sheets
Cascading Style sheetsCascading Style sheets
Using the preceding CSS rules syntax; we can create a CSS
rule to set three background properties (background-color,
background-image, and background-repeat) for the <body>
element, as follows:
Body {background-color: #0000ff; background-image: url
(cimage1.jpg); Background-repeat: repeat-X}
 Shorthand property which enables you to set two or more
properties in one declaration has follows:
 Body {background: 0000ff url (c:image1.jpg) repeat-x}
create cascading styles in a web page in
four ways:
 Using inline styles.
 Using external styles sheets.
 Using internal style sheets
 Using style classes
Inline stylesInline styles
In the inline styles method, style for an HTML element is
specified using it’s style attribute .Inline styles are
useful when you want to define specific styles for
individual elements present on a web page.
External style sheetsExternal style sheets
An external style sheet is a separate document that
contains only CSS rules and has .css extension. External
style sheets are used to apply uniform styles to all the
web pages.
For example, let’s assume that you are creating a
website that contains more than one web page and you
want same look and feel for same types of HTML
elements in all the web pages.
In such a situation, you can first create all the required
CSS rues in an external style sheets and then link it to
all the web pages of the websites.
INTERNAL STYLE SHEETSINTERNAL STYLE SHEETS
Unlike external style sheets, internal style sheets are not
separate documents rather they are style, created inside
an HTML document.
In other words, an internal style sheet is a set of styles
that is created as a part of an HTML document.
These style sheets are useful when you want to apply
similar style to all the elements present on a web page.
Internal style sheets are created using the <style>
element that is added inside the <head> element of the
HTML document.
STYLE CLASSESSTYLE CLASSES
 In style classes method, you can create styles in the form of style classes in
external or embedded style sheets. To apply the style defined in a style class
to an HTML element, you can assign the class attribute of the HTML element
to the name of the style class. You can create two types of style classes:
universal and element specific. A universal style class starts with dot operator
(.) followed by the class name. the syntax to define a universal style class is as
follows
<style>
Class name {class definition}
</style>
 An element specific style class starts with the element name, followed by a dot
operator, which is followed by the class name. the syntax to define an element
specific style class is as follows
<style>
Element name.class name {class definition}
</style>
MULTIPLE STYLEMULTIPLE STYLE
 Multiple styles can be define by using different methods to
implement CSS. For this reason, the use of several external
style sheets result in cascading the styles, which is a
combination of styles for various HTML elements. If multiple
style affect the same element, only the last one is used. You
can link the external style sheets to the document as follows:
 <LINK rel=stylesheet type=”text/css” href=”style1.css”>
 <LINK rel=stylesheet type=”text/css” href=”style2.css”>
 <LINK rel=stylesheet type=”text/css” href=”style3.css”>
MULTIPLE STYLEMULTIPLE STYLE
 If multiple conflicting styles are found in the external style sheets, the CSS
recommendations allow users to select among several alternative style sheets
using the rel attribute of the <STYLE> tag, which is combined with the
TITLE attribute to select them by name :
<LINK rel=”alternate stylesheet” type=”text/css” href=”style1.css”
title=”style1”>
<LINK rel=”alternate stylesheet” type=”text/css” href=”style2.css”
title=”style2”>
<LINK rel=”alternate stylesheet” type=”text/css” href=”style3.css”
title=”style3”>
 
 Multiple style are included in a page by using various possible inclusion
methods. However, the style closest to the content is applied when some
conflict appears among styles

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmeer Khan
 
CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)Ajay Khatri
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheetMichael Jhon
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)Harshita Yadav
 
Introduction of css
Introduction of cssIntroduction of css
Introduction of cssDinesh Kumar
 
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and StyleLesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and StylePerry Mallari
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpcasestudyhelp
 
Css introduction
Css introductionCss introduction
Css introductionSridhar P
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSPrarthan P
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style SheetsMarc Steel
 
Styling of css
Styling of cssStyling of css
Styling of cssJayjZens
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)AakankshaR
 
CSS introduction
CSS introductionCSS introduction
CSS introductionCloudTech 
 

Was ist angesagt? (20)

Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
introduction to CSS
introduction to CSSintroduction to CSS
introduction to CSS
 
CSS
CSS CSS
CSS
 
CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
Introduction of css
Introduction of cssIntroduction of css
Introduction of css
 
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and StyleLesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
chitra
chitrachitra
chitra
 
Css
CssCss
Css
 
Css introduction
Css introductionCss introduction
Css introduction
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Styling of css
Styling of cssStyling of css
Styling of css
 
CSS - LinkedIn
CSS - LinkedInCSS - LinkedIn
CSS - LinkedIn
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 

Ähnlich wie Cascading style sheets

Ähnlich wie Cascading style sheets (20)

Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Lecture 3CSS part 1.pptx
Lecture 3CSS part 1.pptxLecture 3CSS part 1.pptx
Lecture 3CSS part 1.pptx
 
Lecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType ClassificationLecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType Classification
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
CSS Training in Bangalore
CSS Training in BangaloreCSS Training in Bangalore
CSS Training in Bangalore
 
Css
CssCss
Css
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
 
HTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxHTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptx
 
CSS_Day_ONE (W3schools)
CSS_Day_ONE (W3schools)CSS_Day_ONE (W3schools)
CSS_Day_ONE (W3schools)
 
lecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptxlecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptx
 
Css
CssCss
Css
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Unit 2.1
Unit 2.1Unit 2.1
Unit 2.1
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Css siva
Css sivaCss siva
Css siva
 
Css siva
Css sivaCss siva
Css siva
 
Unit 2.1
Unit 2.1Unit 2.1
Unit 2.1
 

Mehr von Jafar Nesargi

Network adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devicesNetwork adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devicesJafar Nesargi
 
An introduction to networking
An introduction to networkingAn introduction to networking
An introduction to networkingJafar Nesargi
 
Computer basics Intro
Computer basics IntroComputer basics Intro
Computer basics IntroJafar Nesargi
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database languageJafar Nesargi
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationJafar Nesargi
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracleJafar Nesargi
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetsJafar Nesargi
 
Session1 gateway to web page development
Session1   gateway to web page developmentSession1   gateway to web page development
Session1 gateway to web page developmentJafar Nesargi
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jspJafar Nesargi
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organizationJafar Nesargi
 

Mehr von Jafar Nesargi (20)

Network adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devicesNetwork adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devices
 
An introduction to networking
An introduction to networkingAn introduction to networking
An introduction to networking
 
Computer basics Intro
Computer basics IntroComputer basics Intro
Computer basics Intro
 
Css
CssCss
Css
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database language
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organization
 
Chapter3
Chapter3Chapter3
Chapter3
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracle
 
Chapter2
Chapter2Chapter2
Chapter2
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Session1 gateway to web page development
Session1   gateway to web page developmentSession1   gateway to web page development
Session1 gateway to web page development
 
Introduction to jsp
Introduction to jspIntroduction to jsp
Introduction to jsp
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
Rmi
RmiRmi
Rmi
 
Java bean
Java beanJava bean
Java bean
 
Networking
NetworkingNetworking
Networking
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
Chapter 1 swings
Chapter 1 swingsChapter 1 swings
Chapter 1 swings
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organization
 

Kürzlich hochgeladen

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Kürzlich hochgeladen (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Cascading style sheets

  • 2. Cascading Style sheetsCascading Style sheets  CSS stands for Cascading Style Sheets  Styles define how to display (X)HTML elements  Styles are normally stored in Style Sheets  Multiple style definitions will cascade into one  Cascading style sheets (CSS) or simply style sheets are text files that contain one or more with in the form of property/value pairs to determine in a Web page should be displayed.  They were developed with the aim to create the structure, look and feel of a Web page but the elements present on the web page are handled separately.
  • 3. Cascading Style sheetsCascading Style sheets CSS deals with all the style-related aspects important to create a web page W3C (world wide web consortium) has developed some specifications. Two versions of CSS specification 1. CSS1 2. CSS2. After the introduction of CSS, HTML elements that purely deal with style related aspects, such as <u>, <center>, and <strike> have been deprecated and W3C has recommended that in place of this HTML element, their replacements should be use in CSS.
  • 4.  The syntax of CSS is slightly different from that HTML. In contrast to the angle brackets (<and>), equal signs, and quotation marks found in the HTML syntax,  The CSS syntax contains curly braces, colons, and semicolons. The syntax of a CSS rule is as follows: Selector {property1: property1-value; property2: property2- value; property3: property3-value………………..} In the preceding syntax, selector is the element that the rule defines, property1, property2, and property3 are the properties (attributes) define for that element, and property1- value, property2-value, and property3-value are values assigned to these properties. The portion of the syntax enclosed within the curly braces is termed as declaration. Cascading Style sheetsCascading Style sheets
  • 5. Cascading Style sheetsCascading Style sheets Using the preceding CSS rules syntax; we can create a CSS rule to set three background properties (background-color, background-image, and background-repeat) for the <body> element, as follows: Body {background-color: #0000ff; background-image: url (cimage1.jpg); Background-repeat: repeat-X}  Shorthand property which enables you to set two or more properties in one declaration has follows:  Body {background: 0000ff url (c:image1.jpg) repeat-x}
  • 6. create cascading styles in a web page in four ways:  Using inline styles.  Using external styles sheets.  Using internal style sheets  Using style classes
  • 7. Inline stylesInline styles In the inline styles method, style for an HTML element is specified using it’s style attribute .Inline styles are useful when you want to define specific styles for individual elements present on a web page.
  • 8. External style sheetsExternal style sheets An external style sheet is a separate document that contains only CSS rules and has .css extension. External style sheets are used to apply uniform styles to all the web pages. For example, let’s assume that you are creating a website that contains more than one web page and you want same look and feel for same types of HTML elements in all the web pages. In such a situation, you can first create all the required CSS rues in an external style sheets and then link it to all the web pages of the websites.
  • 9. INTERNAL STYLE SHEETSINTERNAL STYLE SHEETS Unlike external style sheets, internal style sheets are not separate documents rather they are style, created inside an HTML document. In other words, an internal style sheet is a set of styles that is created as a part of an HTML document. These style sheets are useful when you want to apply similar style to all the elements present on a web page. Internal style sheets are created using the <style> element that is added inside the <head> element of the HTML document.
  • 10. STYLE CLASSESSTYLE CLASSES  In style classes method, you can create styles in the form of style classes in external or embedded style sheets. To apply the style defined in a style class to an HTML element, you can assign the class attribute of the HTML element to the name of the style class. You can create two types of style classes: universal and element specific. A universal style class starts with dot operator (.) followed by the class name. the syntax to define a universal style class is as follows <style> Class name {class definition} </style>  An element specific style class starts with the element name, followed by a dot operator, which is followed by the class name. the syntax to define an element specific style class is as follows <style> Element name.class name {class definition} </style>
  • 11. MULTIPLE STYLEMULTIPLE STYLE  Multiple styles can be define by using different methods to implement CSS. For this reason, the use of several external style sheets result in cascading the styles, which is a combination of styles for various HTML elements. If multiple style affect the same element, only the last one is used. You can link the external style sheets to the document as follows:  <LINK rel=stylesheet type=”text/css” href=”style1.css”>  <LINK rel=stylesheet type=”text/css” href=”style2.css”>  <LINK rel=stylesheet type=”text/css” href=”style3.css”>
  • 12. MULTIPLE STYLEMULTIPLE STYLE  If multiple conflicting styles are found in the external style sheets, the CSS recommendations allow users to select among several alternative style sheets using the rel attribute of the <STYLE> tag, which is combined with the TITLE attribute to select them by name : <LINK rel=”alternate stylesheet” type=”text/css” href=”style1.css” title=”style1”> <LINK rel=”alternate stylesheet” type=”text/css” href=”style2.css” title=”style2”> <LINK rel=”alternate stylesheet” type=”text/css” href=”style3.css” title=”style3”>    Multiple style are included in a page by using various possible inclusion methods. However, the style closest to the content is applied when some conflict appears among styles