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

PPTX
PPTX
Cascading style sheet an introduction
PPT
CSS Introduction
PPT
PPTX
CSS introduction
Cascading style sheet an introduction
CSS Introduction
CSS introduction

What's hot (20)

PPTX
Css how to insert css
PPT
Cascading Style Sheets By Mukesh
PPTX
Welcome to css!
PDF
cascadingstylesheets
PPTX
PPTX
Introduction to HTML and CSS
PPTX
CSS 3, Style and Beyond
PPTX
Html Styles-CSS
PPT
7.2 external style sheets
PPTX
Apa style and citations
PPTX
Web topic 17 font family in css
PPTX
Web Development - Lecture 6
PPTX
Css ms megha
PPTX
Web Development - Lecture 5
PPTX
Web topic 18 conflict resolution in css
PPTX
Web Development - Lecture 4
Css how to insert css
Cascading Style Sheets By Mukesh
Welcome to css!
cascadingstylesheets
Introduction to HTML and CSS
CSS 3, Style and Beyond
Html Styles-CSS
7.2 external style sheets
Apa style and citations
Web topic 17 font family in css
Web Development - Lecture 6
Css ms megha
Web Development - Lecture 5
Web topic 18 conflict resolution in css
Web Development - Lecture 4
Ad

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

PPTX
CSS(Cascading Stylesheet)
PPTX
HTML to CSS Basics Exer 2.pptx
PPTX
cascadingstylesheets,introduction.css styles-210909054722.pptx
PPTX
Cascading style sheets
PPT
CSS Training in Bangalore
PPTX
Cascading style sheets
PPTX
Cascading style sheet, CSS Box model, Table in CSS
PPTX
properties of css.pptx power pointpresentation
PPT
css-presentation.ppt
PPTX
What is CSS.pptx power point presentation
PPTX
Css starting
PPTX
Lecture-6.pptx
PPTX
CSC PPT 4.pptx
PDF
4. Web Technology CSS Basics-1
PPTX
Cashcading stylesheets
PDF
CSS in HTML
PPT
PPT
Cascading Style Sheet
PPTX
Unit iii css and javascript 1
PPTX
Introduction to CSS
CSS(Cascading Stylesheet)
HTML to CSS Basics Exer 2.pptx
cascadingstylesheets,introduction.css styles-210909054722.pptx
Cascading style sheets
CSS Training in Bangalore
Cascading style sheets
Cascading style sheet, CSS Box model, Table in CSS
properties of css.pptx power pointpresentation
css-presentation.ppt
What is CSS.pptx power point presentation
Css starting
Lecture-6.pptx
CSC PPT 4.pptx
4. Web Technology CSS Basics-1
Cashcading stylesheets
CSS in HTML
Cascading Style Sheet
Unit iii css and javascript 1
Introduction to CSS
Ad

Recently uploaded (20)

PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
composite construction of structures.pdf
PPTX
Welding lecture in detail for understanding
PPT
Project quality management in manufacturing
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CYBER-CRIMES AND SECURITY A guide to understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
composite construction of structures.pdf
Welding lecture in detail for understanding
Project quality management in manufacturing
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
OOP with Java - Java Introduction (Basics)
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

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.