SlideShare a Scribd company logo
Name :- Akash Rana
Class :- CE-2
Batch :- A
Enrollment :- 150410107090
Sub :- WT
Topic :- Introduction to CSS, Need for CSS & Its
Basic Syntax
Introduction to CSS
• CSS – Cascading Style Sheet.
• The CSS is a markup language used in the web
development for presentation purpose.
• The primary intension of CSS was to separate out
the web content from the web presentation.
• Various elements such as text ,font and color are
used in CSS for presentation purpose .Thus CSS
specification can be applied to bring the styles in
the web doucument.
Need for CSS
• By combining CSS with the html document,
considerable amount of flexibility into the content
submission can be achieved.
• Similarly, separating out the style from actual contents
help in managing large-scale complex sites.
• If CSS is used, effectively then global style sheet can be
applied to a web document. This helps in maintaining
the consistency in the web document.
• If small change needs to be done in the style of web
content, then CSS makes it more convenient.
Basic Syntax & Structure
• Three levels of CSS :-
 Inline style sheet
 Document level style sheet
 External level style sheet
Inline Style Sheet
• In Inline Style Sheet the styles are applied to HTML
tags. This tag can be applied using the following rule :-
Tag
{ property: value}
For Eg :-
< p style =“font-family: Arial;color:red>
• Here for the tag p two properties are used such as font-
family and color and those are associated with the
values such as arial and red respectively. In the body
section the style sheets are created.
Inline Style Sheet
• This method is called in-line style sheet because
the style is applied at the occurrence of the HTML
element. Using the style attribute the desired
style can be set to the selector.
• Advantages :- We can apply uniform style on tags
for the whole document using inline style sheet.
• Disadvantage :- It is not much suitable for web
page designing because the actual contents of
the web page are mixed with the presentation.
Document Level Style Sheet
• This type of style sheet appears in the head
section and in the body section newly defined
selector tags are used with the actual contents.
• For eg :- In the below HTML script we have
defined h1,h2 and p selectors. For each of these
selectors different property and values are set.
The important thing while writing in this is that
we should have to mention style type=“text/css”
in the head section. By this the browser will come
to know that the program is making use of CSS.
Document Level Style Sheet
• <html>
<head>
<title> Document level style sheet </title>
< style type=“text/css”>
h1
{ font-family: Arial; color:green }
h2
{font-family:Arial; color:red; left:20px }
p
{ font-size:14pt; font-family: verdana}
</style>
</head>
<body>
<h1> <center> hello</center></h1>
<h2> hi</h2>
<p> This is a pragraph </p>
</body>
</html>
Document Level Style Sheet
• Advantages :- Helps to define the layout of the
web page. Used when we want to apply the
unique style sheet for the web page.
• Disadvantages :- When we want to apply the
style to more than one documents at a time
then the document level style sheet is of no
use.
External Style Sheet
• When we want to apply particular style to
more than one web documents in such case
external style sheet is used.
• The central idea in this type of style sheet is
that the desired style is stored in one .css file.
• And the name of that file has to be mentioned
in our webpage. Then the styles defined in .css
file will be applied to all these web pages.
External Style Sheet
<html>
<head>
<link rel=“stylesheet” type=“text/css” href=“ex1.css”/>
</head>
<body>
<h1><center> Hello </center></h1>
<p> Paragraph </p></body></html>
The cascading style sheet ex1.css can be
h1
{ font-family:Arial}
p
{font-family:Monotype Corsiva; font-size:14pt}
External Style Sheet
• When we want to link external style sheet
then we have to use <link> tag which is to be
written in the head section.
• Advantage :- If we want to change any style
then we have to modify only one file.
Thank You…

More Related Content

What's hot

Css how to insert css
Css how to insert cssCss how to insert css
Css how to insert css
Sumit Rana
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
Welcome to css!
Welcome to css!Welcome to css!
Welcome to css!
sidneyodingo
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
Css
CssCss
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
danpaquette
 
CSS 3, Style and Beyond
CSS 3, Style and BeyondCSS 3, Style and Beyond
CSS 3, Style and Beyond
Samsung Open Source Group
 
Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
ispkosova
 
7.2 external style sheets
7.2 external style sheets7.2 external style sheets
7.2 external style sheetsBulldogs83
 
Apa style and citations
Apa style and citationsApa style and citations
Apa style and citations
Rachel Owens
 
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 Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
Syed Shahzaib Sohail
 
Css ms megha
Css ms meghaCss ms megha
Css ms megha
Megha Gupta
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
Syed Shahzaib Sohail
 
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 Development - Lecture 4
Web Development - Lecture 4Web Development - Lecture 4
Web Development - Lecture 4
Syed Shahzaib Sohail
 

What's hot (20)

Css how to insert css
Css how to insert cssCss how to insert css
Css how to insert css
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
Welcome to css!
Welcome to css!Welcome to css!
Welcome to css!
 
Css
CssCss
Css
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Css
CssCss
Css
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Acrobat 101
Acrobat 101Acrobat 101
Acrobat 101
 
CSS
CSSCSS
CSS
 
CSS 3, Style and Beyond
CSS 3, Style and BeyondCSS 3, Style and Beyond
CSS 3, Style and Beyond
 
Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
 
7.2 external style sheets
7.2 external style sheets7.2 external style sheets
7.2 external style sheets
 
Apa style and citations
Apa style and citationsApa style and citations
Apa style and citations
 
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
 
Css
CssCss
Css
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
 
Css ms megha
Css ms meghaCss ms megha
Css ms megha
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
 
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 Development - Lecture 4
Web Development - Lecture 4Web Development - Lecture 4
Web Development - Lecture 4
 

Similar to Need for css,introduction to css & basic syntax wt

Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
smithaps4
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
smitha273566
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
Vladimir Valencia
 
Css introduction
Css  introductionCss  introduction
Css introduction
vishnu murthy
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1
jeweltutin
 
CSS Basics part One
CSS Basics part OneCSS Basics part One
CSS Basics part One
M Ashraful Islam Jewel
 
Css introduction
Css introductionCss introduction
Css introductionSridhar P
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
elayelily
 
6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt
VARNITBHASKAR1
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
MattMarino13
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
Webtech Learning
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
Umesh Agarwal
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
MattMarino13
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
Sónia
 
Css tutorial
Css tutorialCss tutorial
Css tutorialvedaste
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
MattMarino13
 
CSS INTRODUCTION SLIDES WITH HTML CODE.pdf
CSS INTRODUCTION SLIDES WITH HTML CODE.pdfCSS INTRODUCTION SLIDES WITH HTML CODE.pdf
CSS INTRODUCTION SLIDES WITH HTML CODE.pdf
Aasma13
 

Similar to Need for css,introduction to css & basic syntax wt (20)

Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1
 
CSS Basics part One
CSS Basics part OneCSS Basics part One
CSS Basics part One
 
Css introduction
Css introductionCss introduction
Css introduction
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
 
6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt
 
CSS
CSSCSS
CSS
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
Css tutorial
Css tutorialCss tutorial
Css tutorial
 
Css present
Css presentCss present
Css present
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
 
CSS INTRODUCTION SLIDES WITH HTML CODE.pdf
CSS INTRODUCTION SLIDES WITH HTML CODE.pdfCSS INTRODUCTION SLIDES WITH HTML CODE.pdf
CSS INTRODUCTION SLIDES WITH HTML CODE.pdf
 

Recently uploaded

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 

Recently uploaded (20)

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 

Need for css,introduction to css & basic syntax wt

  • 1. Name :- Akash Rana Class :- CE-2 Batch :- A Enrollment :- 150410107090 Sub :- WT
  • 2. Topic :- Introduction to CSS, Need for CSS & Its Basic Syntax
  • 3. Introduction to CSS • CSS – Cascading Style Sheet. • The CSS is a markup language used in the web development for presentation purpose. • The primary intension of CSS was to separate out the web content from the web presentation. • Various elements such as text ,font and color are used in CSS for presentation purpose .Thus CSS specification can be applied to bring the styles in the web doucument.
  • 4. Need for CSS • By combining CSS with the html document, considerable amount of flexibility into the content submission can be achieved. • Similarly, separating out the style from actual contents help in managing large-scale complex sites. • If CSS is used, effectively then global style sheet can be applied to a web document. This helps in maintaining the consistency in the web document. • If small change needs to be done in the style of web content, then CSS makes it more convenient.
  • 5. Basic Syntax & Structure • Three levels of CSS :-  Inline style sheet  Document level style sheet  External level style sheet
  • 6. Inline Style Sheet • In Inline Style Sheet the styles are applied to HTML tags. This tag can be applied using the following rule :- Tag { property: value} For Eg :- < p style =“font-family: Arial;color:red> • Here for the tag p two properties are used such as font- family and color and those are associated with the values such as arial and red respectively. In the body section the style sheets are created.
  • 7. Inline Style Sheet • This method is called in-line style sheet because the style is applied at the occurrence of the HTML element. Using the style attribute the desired style can be set to the selector. • Advantages :- We can apply uniform style on tags for the whole document using inline style sheet. • Disadvantage :- It is not much suitable for web page designing because the actual contents of the web page are mixed with the presentation.
  • 8. Document Level Style Sheet • This type of style sheet appears in the head section and in the body section newly defined selector tags are used with the actual contents. • For eg :- In the below HTML script we have defined h1,h2 and p selectors. For each of these selectors different property and values are set. The important thing while writing in this is that we should have to mention style type=“text/css” in the head section. By this the browser will come to know that the program is making use of CSS.
  • 9. Document Level Style Sheet • <html> <head> <title> Document level style sheet </title> < style type=“text/css”> h1 { font-family: Arial; color:green } h2 {font-family:Arial; color:red; left:20px } p { font-size:14pt; font-family: verdana} </style> </head> <body> <h1> <center> hello</center></h1> <h2> hi</h2> <p> This is a pragraph </p> </body> </html>
  • 10. Document Level Style Sheet • Advantages :- Helps to define the layout of the web page. Used when we want to apply the unique style sheet for the web page. • Disadvantages :- When we want to apply the style to more than one documents at a time then the document level style sheet is of no use.
  • 11. External Style Sheet • When we want to apply particular style to more than one web documents in such case external style sheet is used. • The central idea in this type of style sheet is that the desired style is stored in one .css file. • And the name of that file has to be mentioned in our webpage. Then the styles defined in .css file will be applied to all these web pages.
  • 12. External Style Sheet <html> <head> <link rel=“stylesheet” type=“text/css” href=“ex1.css”/> </head> <body> <h1><center> Hello </center></h1> <p> Paragraph </p></body></html> The cascading style sheet ex1.css can be h1 { font-family:Arial} p {font-family:Monotype Corsiva; font-size:14pt}
  • 13. External Style Sheet • When we want to link external style sheet then we have to use <link> tag which is to be written in the head section. • Advantage :- If we want to change any style then we have to modify only one file.