SlideShare a Scribd company logo
1 of 15
CSS
Cascading Style Sheet
S.Muthuganesh M.Sc.,B.Ed.,
CSS
• CSS stands for Cascading Style Sheet.
• CSS is used to design HTML tags.
• CSS is a widely used language on the web.
• CSS is used along with HTML and JavaScript in most websites to create user
interfaces for web applications and user interfaces for many mobile applications.
• CSS style definitions are saved in external CSS files so it is possible to change the
entire website by changing just one file.
Muthuganesh S 2
Three Ways to Insert
CSS
• External CSS
• Internal CSS
• Inline CSS
• An external style sheet can be written in any text editor,
and must be saved with a .css extension.
• The external .css file should not contain any HTML tags.
• The internal style is defined inside the <style>…</style>
element, inside the head section.
• An inline style may be used to apply a unique style for a
single element.
Muthuganesh S 3
CSS SYNTAX
• Each declaration includes a CSS property name
and a value, separated by a colon(:).
• Multiple CSS declarations are separated with
semicolons(;)
• declaration blocks are surrounded by curly
braces{ }
Muthuganesh S 4
Where to
• styles are defined within the <style>…</style> element, inside the <head>…</head> section
of an HTML page
<html>
<head>
<title> First CSS</title>
<style type=“text/css”>
p
{
text-align:center;
font-family:verdana;
}
</style>
<body>
<p>Welcome Guys!!!</p>
</body>
</html> Muthuganesh S 5
CSS selectors
• CSS selectors are used to select the content you want to style
Here are several different types of selectors in CSS.
• CSS Element Selector
• CSS Id Selector
• CSS Class Selector
• CSS Universal Selector
• CSS Group Selector
Muthuganesh S 6
ELEMENT SELECTOR
• The element selector selects the HTML element by name, elements
are paragraph tag<p>…</p>, header tags<h1>…</h1>
• Example
p
{
font-family:Verdana;color:red;size:10;text-align:right;
}
Muthuganesh S 7
Id selector
• The id selector uses the id attribute of an HTML element to select a specific
element.
• write a hash (#) character, followed by the id of the element.
Example
#style1
{
font-size:5px;
text-align:center;
background-color: lightblue;
}
• <p id=“style1”> Welcome to Department of Computer Science</P>
Muthuganesh S 8
class selector
• The class selector selects HTML elements with a specific class attribute. It is
declared with a period character . (full stop symbol) followed by the class name.
Example
.classstyle
{
border:1px solidblack;
background-color:yellow;
}
<div class=“classstyle”>
Welcome
</div>
Muthuganesh S 9
The CSS Universal Selector
• The universal selector (*) selects all HTML elements on the page.
Example
*{
text-align:center;
background-image:url(“shiva.jpg”);
}
Muthuganesh S 10
Group selector
• The grouping selector selects all the HTML elements with the same
style like h1,p,h2 all has same style.
• Example
p,h1,h2
{
font-family:serif;
color:blue;
}
Muthuganesh S 11
Inline style
• Its used to change specific element with help of style as attribute.
• add the style as attribute to the relevant element. The style attribute can contain
any CSS property.
<html>
<head><title>inline style</title>
</head>
<body>
<p style="color:red;text-align:center;"> This Paragraph Style</p>
</body>
</html>
Muthuganesh S 12
External Style Sheet
• Its used for when we want multiple webpages.
• Its help to change a look of entire website by the change of single file.
• It uses the <link> tag on every pages and the <link> tag should be put
inside the head section.
• The external style sheet may be written in any text editor but must be
saved with a .css extension.
• This file should not contain HTML elements.
Muthuganesh S 13
Example
h1{ color:green;}
body{background-color:yellow;}
Save this file as stylesheet1.css. Use this file as a link in every webpage.
<html>
<head>
<title>stylesheet</title>
<link rel=“stylesheet” href=“stylesheet1.css”/>
</head>
<body>
<h1>Welcome!!!</h1>
</body>
</html>
Muthuganesh S 14
Thank You
Muthuganesh S 15

More Related Content

What's hot (19)

Css and its types
Css and its typesCss and its types
Css and its types
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
CSS Basic Introduction, Rules, And Tips
CSS Basic Introduction, Rules, And TipsCSS Basic Introduction, Rules, And Tips
CSS Basic Introduction, Rules, And Tips
 
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
 
HTML and CSS
HTML and CSSHTML and CSS
HTML and CSS
 
The three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth yearThe three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth year
 
CSS 3, Style and Beyond
CSS 3, Style and BeyondCSS 3, Style and Beyond
CSS 3, Style and Beyond
 
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
 
Cmsc 100 xhtml and css
Cmsc 100 xhtml and cssCmsc 100 xhtml and css
Cmsc 100 xhtml and css
 
Css
CssCss
Css
 
chitra
chitrachitra
chitra
 
Css
CssCss
Css
 
Html and css
Html and cssHtml and css
Html and css
 
Css present
Css presentCss present
Css present
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
 
introduction to CSS
introduction to CSSintroduction to CSS
introduction to CSS
 
Session v(css)
Session v(css)Session v(css)
Session v(css)
 

Similar to CSS

Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...JebaRaj26
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxkarthiksmart21
 
Introduction HTML and CSS
Introduction HTML and CSSIntroduction HTML and CSS
Introduction HTML and CSSGovtITIWomen
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmithaps4
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmitha273566
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxalvindalejoyosa1
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssTesfaye Yenealem
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designersSingsys Pte Ltd
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2Sónia
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptxMattMarino13
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptxMattMarino13
 
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 JAVApdfelayelily
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)AakankshaR
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introductionHimanshu Pathak
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Gheyath M. Othman
 

Similar to CSS (20)

Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
 
Introduction HTML and CSS
Introduction HTML and CSSIntroduction HTML and CSS
Introduction HTML and CSS
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Css.html
Css.htmlCss.html
Css.html
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Web technology Unit-II Part-C
Web technology Unit-II Part-CWeb technology Unit-II Part-C
Web technology Unit-II Part-C
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Unit 3 (it workshop).pptx
Unit 3 (it workshop).pptxUnit 3 (it workshop).pptx
Unit 3 (it workshop).pptx
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
 
CSS.ppt
CSS.pptCSS.ppt
CSS.ppt
 
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
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introduction
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 

More from Muthuganesh S

More from Muthuganesh S (12)

javascript.pptx
javascript.pptxjavascript.pptx
javascript.pptx
 
OR
OROR
OR
 
Operation Research VS Software Engineering
Operation Research VS Software EngineeringOperation Research VS Software Engineering
Operation Research VS Software Engineering
 
Cnotes
CnotesCnotes
Cnotes
 
Conditional statement in c
Conditional statement in cConditional statement in c
Conditional statement in c
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
 
Php notes
Php notesPhp notes
Php notes
 
Php Basics Iterations, looping
Php Basics Iterations, loopingPhp Basics Iterations, looping
Php Basics Iterations, looping
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Php
PhpPhp
Php
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Javascript dom
Javascript domJavascript dom
Javascript dom
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
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
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
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
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

CSS

  • 2. CSS • CSS stands for Cascading Style Sheet. • CSS is used to design HTML tags. • CSS is a widely used language on the web. • CSS is used along with HTML and JavaScript in most websites to create user interfaces for web applications and user interfaces for many mobile applications. • CSS style definitions are saved in external CSS files so it is possible to change the entire website by changing just one file. Muthuganesh S 2
  • 3. Three Ways to Insert CSS • External CSS • Internal CSS • Inline CSS • An external style sheet can be written in any text editor, and must be saved with a .css extension. • The external .css file should not contain any HTML tags. • The internal style is defined inside the <style>…</style> element, inside the head section. • An inline style may be used to apply a unique style for a single element. Muthuganesh S 3
  • 4. CSS SYNTAX • Each declaration includes a CSS property name and a value, separated by a colon(:). • Multiple CSS declarations are separated with semicolons(;) • declaration blocks are surrounded by curly braces{ } Muthuganesh S 4
  • 5. Where to • styles are defined within the <style>…</style> element, inside the <head>…</head> section of an HTML page <html> <head> <title> First CSS</title> <style type=“text/css”> p { text-align:center; font-family:verdana; } </style> <body> <p>Welcome Guys!!!</p> </body> </html> Muthuganesh S 5
  • 6. CSS selectors • CSS selectors are used to select the content you want to style Here are several different types of selectors in CSS. • CSS Element Selector • CSS Id Selector • CSS Class Selector • CSS Universal Selector • CSS Group Selector Muthuganesh S 6
  • 7. ELEMENT SELECTOR • The element selector selects the HTML element by name, elements are paragraph tag<p>…</p>, header tags<h1>…</h1> • Example p { font-family:Verdana;color:red;size:10;text-align:right; } Muthuganesh S 7
  • 8. Id selector • The id selector uses the id attribute of an HTML element to select a specific element. • write a hash (#) character, followed by the id of the element. Example #style1 { font-size:5px; text-align:center; background-color: lightblue; } • <p id=“style1”> Welcome to Department of Computer Science</P> Muthuganesh S 8
  • 9. class selector • The class selector selects HTML elements with a specific class attribute. It is declared with a period character . (full stop symbol) followed by the class name. Example .classstyle { border:1px solidblack; background-color:yellow; } <div class=“classstyle”> Welcome </div> Muthuganesh S 9
  • 10. The CSS Universal Selector • The universal selector (*) selects all HTML elements on the page. Example *{ text-align:center; background-image:url(“shiva.jpg”); } Muthuganesh S 10
  • 11. Group selector • The grouping selector selects all the HTML elements with the same style like h1,p,h2 all has same style. • Example p,h1,h2 { font-family:serif; color:blue; } Muthuganesh S 11
  • 12. Inline style • Its used to change specific element with help of style as attribute. • add the style as attribute to the relevant element. The style attribute can contain any CSS property. <html> <head><title>inline style</title> </head> <body> <p style="color:red;text-align:center;"> This Paragraph Style</p> </body> </html> Muthuganesh S 12
  • 13. External Style Sheet • Its used for when we want multiple webpages. • Its help to change a look of entire website by the change of single file. • It uses the <link> tag on every pages and the <link> tag should be put inside the head section. • The external style sheet may be written in any text editor but must be saved with a .css extension. • This file should not contain HTML elements. Muthuganesh S 13
  • 14. Example h1{ color:green;} body{background-color:yellow;} Save this file as stylesheet1.css. Use this file as a link in every webpage. <html> <head> <title>stylesheet</title> <link rel=“stylesheet” href=“stylesheet1.css”/> </head> <body> <h1>Welcome!!!</h1> </body> </html> Muthuganesh S 14