SlideShare a Scribd company logo
1 of 11
Introduction to CSS
What is CSS
• Cascading-Style-Sheet:
• It is a language which is used to add style to
various HTML tags (elements).
• It is used to define(style) the elements of
various tags as per user style.
• CSS allows re-usability.
Defining <H1> Elements with CSS
<HTML>
<HEAD>
<STYLE>
H1
{
ALIGN:CENTER;
BACKGROUND-COLOR: GREEN;
COLOR: WHITE;
FONT-FAMILY:VERDANA;
TEXT-ALIGN:CENTER;
}
</STYLE>
</HEAD>
<BODY BGCOLOR="AQUA">
<H1>THIS IS CSS STYLE H1</H1>
<H1>THIS IS ANOTHER CSS H1</H1>
</BODY>
</HTML>
Defining <P> Elements with CSS
<html>
<head>
<title>CSS PARAGRAPH</title>
<style>
p {
color: red;
text-align: right;
font-size: 44px;
}
</style>
</head>
<body bgcolor="yellow">
<h1>PARAGRPH TAG WITH CSS</h1>
<hr color="green" size=10 length=100></hr>
<p>My Paragraph with css </p>
</body>
</html>
CSS Syntax
• 3 Elements to a CSS Statement
– Selector
• Tells,What HTML sections does it affect (tags)
– Property
• Tells,What attribute of that HTML section will be affected
– Value
• Tells,What value will be made to that attribute or property
Three CSS Definition Locations
• Inline: the “style” attribute (along with tag)
Note, the selector for inline CSS is the tag which contains the style attribute.
• Internal: the <style> markup tag (inside <head>
tag
• External: the .css stylesheet file
<p style=“font-color:red;font-size:10px;”>Content</p>
<html><head><style>
p { background-color: Red;
font-family: serif;
font-color: White; }
</style></head><body>
<p>Content</p>
</body></html>
<link rel="stylesheet" type="text/css" href=“mystylesheet.css" />
CSS CLASS
The .class selector is used to select all elements
which belong to a particular class attribute.
Syntax:
.class {
// CSS property
}
Css id vs class
Class Id
We can apply a class to various elements
so that it could be numerous times on a
single page.
The Id is unique in a page, and we can
only apply it to one specific element.
The class is assigned to an element and
its name starts with "." followed by the
name of the class.
The name of the Id starts with the "#"
symbol followed by a unique id name.
We can attach multiple class selectors to
an element.
We can attach only one ID selector to an
element.
Syntax:
.class{
// declarations of CSS
}
Syntax:
#id{
// declarations of CSS
}
<html>
<head>
<style>
p.rama {
font-size: 200%;
text-align: center;
color: red;
}
p.sita {
font-size: 300%;
color:green;
text-align:left;
}
</style>
</head>
<body bgcolor="pink">
<h1 align="center">class selector </h1>
<hr color="red" size=10 length=100></hr>
<p class="rama">WORK IS WORSHIP with class rama style</p>
<p class="sita">HONESTY IS BEST POLICY with class sita style</p>
</body>
</html>
CSS for more elements (tags)

More Related Content

Similar to Introduction to CSS.pptx (20)

Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
 
Html html html html html html html html html
Html html html html html html html html htmlHtml html html html html html html html html
Html html html html html html html html html
 
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
CssCss
Css
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
 
Css
CssCss
Css
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
 
css1.ppt
css1.pptcss1.ppt
css1.ppt
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
CSS-part-1.ppt
CSS-part-1.pptCSS-part-1.ppt
CSS-part-1.ppt
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
Styles.docx
Styles.docxStyles.docx
Styles.docx
 
Styles.docx
Styles.docxStyles.docx
Styles.docx
 
Styles.docx
Styles.docxStyles.docx
Styles.docx
 
Styles1.docx
Styles1.docxStyles1.docx
Styles1.docx
 

Recently uploaded

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
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
 
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
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
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
 
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
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Introduction to CSS.pptx

  • 2. What is CSS • Cascading-Style-Sheet: • It is a language which is used to add style to various HTML tags (elements). • It is used to define(style) the elements of various tags as per user style. • CSS allows re-usability.
  • 3. Defining <H1> Elements with CSS <HTML> <HEAD> <STYLE> H1 { ALIGN:CENTER; BACKGROUND-COLOR: GREEN; COLOR: WHITE; FONT-FAMILY:VERDANA; TEXT-ALIGN:CENTER; } </STYLE> </HEAD> <BODY BGCOLOR="AQUA"> <H1>THIS IS CSS STYLE H1</H1> <H1>THIS IS ANOTHER CSS H1</H1> </BODY> </HTML>
  • 4. Defining <P> Elements with CSS <html> <head> <title>CSS PARAGRAPH</title> <style> p { color: red; text-align: right; font-size: 44px; } </style> </head> <body bgcolor="yellow"> <h1>PARAGRPH TAG WITH CSS</h1> <hr color="green" size=10 length=100></hr> <p>My Paragraph with css </p> </body> </html>
  • 5.
  • 6. CSS Syntax • 3 Elements to a CSS Statement – Selector • Tells,What HTML sections does it affect (tags) – Property • Tells,What attribute of that HTML section will be affected – Value • Tells,What value will be made to that attribute or property
  • 7. Three CSS Definition Locations • Inline: the “style” attribute (along with tag) Note, the selector for inline CSS is the tag which contains the style attribute. • Internal: the <style> markup tag (inside <head> tag • External: the .css stylesheet file <p style=“font-color:red;font-size:10px;”>Content</p> <html><head><style> p { background-color: Red; font-family: serif; font-color: White; } </style></head><body> <p>Content</p> </body></html> <link rel="stylesheet" type="text/css" href=“mystylesheet.css" />
  • 8. CSS CLASS The .class selector is used to select all elements which belong to a particular class attribute. Syntax: .class { // CSS property }
  • 9. Css id vs class Class Id We can apply a class to various elements so that it could be numerous times on a single page. The Id is unique in a page, and we can only apply it to one specific element. The class is assigned to an element and its name starts with "." followed by the name of the class. The name of the Id starts with the "#" symbol followed by a unique id name. We can attach multiple class selectors to an element. We can attach only one ID selector to an element. Syntax: .class{ // declarations of CSS } Syntax: #id{ // declarations of CSS }
  • 10. <html> <head> <style> p.rama { font-size: 200%; text-align: center; color: red; } p.sita { font-size: 300%; color:green; text-align:left; } </style> </head> <body bgcolor="pink"> <h1 align="center">class selector </h1> <hr color="red" size=10 length=100></hr> <p class="rama">WORK IS WORSHIP with class rama style</p> <p class="sita">HONESTY IS BEST POLICY with class sita style</p> </body> </html>
  • 11. CSS for more elements (tags)