SlideShare a Scribd company logo
COMPUTER APPLICATIONS
CLASS X (Code 165)
TOPIC:
UNIT 2: Cascading Style Sheets – Part 2
By
HIMANSHU PATHAK
Contents
• Introduction
• Text styling
• Web-page styling
CSS Color
• In CSS, a color can be specified by using a
predefined color name or RGB or Hex values.
• With CSS, a color is most often specified by:
– a valid color name - like "red"
– a HEX value - like "#ff0000"
– an RGB value - like "rgb(255,0,0)"
• we can set the color of text:
– <h1 style="color : red;">Hello World</h1>
CSS Backgrounds
• You can set the background color for HTML
elements:
– <p style="background-color : blue;">Himanshu </p>
• The opacity property specifies the transparency
of an element. It can take a value from 0.0 - 1.0.
• <p style=“opacity : 0.3; ">Himanshu </p>
• The background-image property specifies an image to
use as the background of an element.
body {
background-image: url("paper.gif");
}
CSS Borders
• The CSS border properties allow you to specify
the style, width, and color of an element's
border.
• The border-style property specifies what kind of
border to display.
• The following values are allowed:
– dotted - Defines a dotted border
– dashed - Defines a dashed border
– solid - Defines a solid border
– double - Defines a double border
Cont…
• The border-width property specifies the width of
the four borders.
• The width can be set as a specific size (in px, pt,
cm, em, etc) or by using one of the three pre-
defined values: thin, medium, or thick.
• The border-width property can have from one to
four values (for the top border, right border,
bottom border, and the left border)
• <p style=“border-style : dotted; border-width: 5px; ”>Himanshu
</p>
Cont…
• The border-color property is used to set the
color of the four borders.
• If border-color is not set, it inherits the color
of the element.
<p style=“border-style : dotted; border-width: 5px;
border-color: red”>Himanshu </p>
CSS Margins
• Margins are used to create space around elements, outside of any defined
borders.
• There are properties for setting the margin for each side of an element (top,
right, bottom, and left).
• All the margin properties can have the following values:
– auto - the browser calculates the margin
– length - specifies a margin in px, pt, cm, etc.
– % - specifies a margin in % of the width of the containing element
• p {
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
}
• Use the margin shorthand property with four values:
• p {
margin: 25px 50px 75px 100px;
}
CSS Height & Width
• The height and width properties are used to set the height
and width of an element.
• The height and width properties do not include padding,
borders, or margins.
• The height and width properties may have the following
values:
– auto - This is default. The browser calculates the height and
width
– length - Defines the height/width in px, cm etc.
– % - Defines the height/width in percent of the containing block
– initial - Sets the height/width to its default value
– inherit - The height/width will be inherited from its parent
value
Cont…
• Example:
<style>
div {
height: 200px;
width: 50%;
}
</style>
CSS Outline
• An outline is a line that is drawn around elements,
OUTSIDE the borders, to make the element "stand out".
• CSS has the following outline properties:
– outline-style
– outline-color
– outline-width
• The outline-style property specifies the style of the
outline, and can have one of the following values:
– dotted - Defines a dotted outline
– dashed - Defines a dashed outline
– solid - Defines a solid outline
– double - Defines a double outline
Cont…
• The outline-width property specifies the width of
the outline, and can have one of the following
values:
– thin (typically 1px)
– medium (typically 3px)
– thick (typically 5px)
• The outline-color property is used to set the color of
the outline.
– The color can be set by:
• name - specify a color name, like "red"
• HEX - specify a hex value, like "#ff0000"
• RGB - specify a RGB value, like "rgb(255,0,0)"
CSS Fonts
• CSS Font property is used to control the look of
texts.
• By the use of CSS font property you can change
the text size, color, style and more.
• font-family: This property is used to change the
face of the font.
• font-size: This property is used to increase or
decrease the size of the font.
• font-style: This property is used to make the font
bold, italic or oblique.
CSS Font-Family
• In CSS there are five generic font families:
– Serif fonts have a small stroke at the edges of each letter.
They create a sense of formality and elegance.
– Sans-serif fonts have clean lines (no small strokes
attached). They create a modern and minimalistic look.
– Monospace fonts - here all the letters have the same
fixed width. They create a mechanical look.
– Cursive fonts imitate human handwriting.
– Fantasy fonts are decorative/playful fonts.
• All the different font names belong to one of the
generic font families.
Cont…
Cont…
• Example:
<style>
h1 { font-family: sans-serif; }
h2 { font-family: serif; }
p { font-family: monospace; }
</style>
CSS Font Size
• The font-size property is used to control the size
of fonts.
• Possible values could be xx-small, x-small, small,
medium, large, x-large, xx-large, smaller, larger,
size in pixels or in %.
• <p style = "font-size : 20px;"> This font size is 20
pixels </p>
• <p style = "font-size : small;"> This font size is
small </p>
CSS Font Style
• CSS font-style property defines what type of font
you want to display.
• It may be italic, oblique, or normal.
<style>
h2 { font-style: italic; }
p { font-style: oblique; }
h4 { font-style: normal; }
</style>
CSS Float
• The CSS float property is a positioning property.
• It is used to push an element to the left or right,
allowing other element to wrap around it.
• It is generally used with images and layouts.
• Elements are floated only horizontally. So it is
possible only to float elements left or right, not
up or down.
• The float property can have one of the following
values: left, right, none, inherit
Cont…
<style>
img {
float: right;
}
</style>
CSS align
• The text-align property is used to set the horizontal
alignment of a text.
• A text can be left or right aligned, centered, or
justified.
• h1 {
text-align: center;
}
h2 {
text-align: left;
}
Summary
• How to incorporate basic text and web page
design properties using CSS.
• In the next class, we will start Unit III – Cyber
Ethics in detail.
•Thanks

More Related Content

What's hot

Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
David Engel
 
Web Programming& Scripting Lab
Web Programming& Scripting LabWeb Programming& Scripting Lab
Web Programming& Scripting Lab
Swapnali Pawar
 
Compass/Sass
Compass/SassCompass/Sass
Compass/Sass
guest2409d3
 
Css
CssCss
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
Idan Gazit
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
Steve Guinan
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
Derek Christensen
 
Prototyping With Haml & Sass
Prototyping With Haml & SassPrototyping With Haml & Sass
Prototyping With Haml & Sass
amwatts
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
Russ Weakley
 
Background property in css
Background property in cssBackground property in css
Background property in css
Dhruvin Nakrani
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
Knoldus Inc.
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
Denise Jacobs
 
Colors In CSS3
Colors In CSS3Colors In CSS3
Colors In CSS3
Lea Verou
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
Steve Guinan
 
DrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & EffectsDrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & Effects
Shawn Villaron
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
Knoldus Inc.
 
Css color and background properties
Css color and background propertiesCss color and background properties
Css color and background properties
Jesus Obenita Jr.
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
Denise Jacobs
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3
Shay Howe
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
Gene Babon
 

What's hot (20)

Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
 
Web Programming& Scripting Lab
Web Programming& Scripting LabWeb Programming& Scripting Lab
Web Programming& Scripting Lab
 
Compass/Sass
Compass/SassCompass/Sass
Compass/Sass
 
Css
CssCss
Css
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Prototyping With Haml & Sass
Prototyping With Haml & SassPrototyping With Haml & Sass
Prototyping With Haml & Sass
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
 
Background property in css
Background property in cssBackground property in css
Background property in css
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
 
Colors In CSS3
Colors In CSS3Colors In CSS3
Colors In CSS3
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
DrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & EffectsDrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & Effects
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Css color and background properties
Css color and background propertiesCss color and background properties
Css color and background properties
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 

Similar to Cascading style sheet part 2

CSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.ECSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.E
NavyaEnugala
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2
jeweltutin
 
Unit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptxUnit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptx
kushwahanitesh592
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
Gheyath M. Othman
 
CSS
CSSCSS
Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
Syed Shahzaib Sohail
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
Nosheen Qamar
 
Css outlines
Css outlinesCss outlines
Css outlines
AbhishekMondal42
 
Web - CSS 1.pptx
Web - CSS 1.pptxWeb - CSS 1.pptx
Web - CSS 1.pptx
haroon451422
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
Umesh Agarwal
 
css.pdf
css.pdfcss.pdf
CSS
CSSCSS
Pemrograman Web 2 - CSS
Pemrograman Web 2 - CSSPemrograman Web 2 - CSS
Pemrograman Web 2 - CSS
Nur Fadli Utomo
 
Css
CssCss
Css
CssCss
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
Nosheen Qamar
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
VarunMM2
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
VarunMM2
 

Similar to Cascading style sheet part 2 (20)

CSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.ECSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.E
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2
 
Unit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptxUnit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptx
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
CSS
CSSCSS
CSS
 
Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
Dimensions of elements.pdf
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
 
Css outlines
Css outlinesCss outlines
Css outlines
 
Web - CSS 1.pptx
Web - CSS 1.pptxWeb - CSS 1.pptx
Web - CSS 1.pptx
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
 
css.pdf
css.pdfcss.pdf
css.pdf
 
CSS
CSSCSS
CSS
 
Pemrograman Web 2 - CSS
Pemrograman Web 2 - CSSPemrograman Web 2 - CSS
Pemrograman Web 2 - CSS
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 

More from Himanshu Pathak

Introduction to E commerce
Introduction to E commerceIntroduction to E commerce
Introduction to E commerce
Himanshu Pathak
 
Digital property rights
Digital property rightsDigital property rights
Digital property rights
Himanshu Pathak
 
Intellectual property rights
Intellectual property rightsIntellectual property rights
Intellectual property rights
Himanshu Pathak
 
An Introduction to Cyber Ethics
An Introduction to Cyber EthicsAn Introduction to Cyber Ethics
An Introduction to Cyber Ethics
Himanshu Pathak
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introduction
Himanshu Pathak
 
Html multimedia
Html multimediaHtml multimedia
Html multimedia
Himanshu Pathak
 
Html forms
Html formsHtml forms
Html forms
Himanshu Pathak
 
Html tables
Html tablesHtml tables
Html tables
Himanshu Pathak
 
Html link and list tags
Html link and list tagsHtml link and list tags
Html link and list tags
Himanshu Pathak
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
Himanshu Pathak
 
Basic html tags
Basic html tagsBasic html tags
Basic html tags
Himanshu Pathak
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
Himanshu Pathak
 
Mobile technologies
Mobile technologiesMobile technologies
Mobile technologies
Himanshu Pathak
 
Web services
Web servicesWeb services
Web services
Himanshu Pathak
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer Protocols
Himanshu Pathak
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
Himanshu Pathak
 
Introduction to internet
Introduction to internetIntroduction to internet
Introduction to internet
Himanshu Pathak
 
What is Computer?
What is Computer?What is Computer?
What is Computer?
Himanshu Pathak
 

More from Himanshu Pathak (18)

Introduction to E commerce
Introduction to E commerceIntroduction to E commerce
Introduction to E commerce
 
Digital property rights
Digital property rightsDigital property rights
Digital property rights
 
Intellectual property rights
Intellectual property rightsIntellectual property rights
Intellectual property rights
 
An Introduction to Cyber Ethics
An Introduction to Cyber EthicsAn Introduction to Cyber Ethics
An Introduction to Cyber Ethics
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introduction
 
Html multimedia
Html multimediaHtml multimedia
Html multimedia
 
Html forms
Html formsHtml forms
Html forms
 
Html tables
Html tablesHtml tables
Html tables
 
Html link and list tags
Html link and list tagsHtml link and list tags
Html link and list tags
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
 
Basic html tags
Basic html tagsBasic html tags
Basic html tags
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Mobile technologies
Mobile technologiesMobile technologies
Mobile technologies
 
Web services
Web servicesWeb services
Web services
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer Protocols
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
 
Introduction to internet
Introduction to internetIntroduction to internet
Introduction to internet
 
What is Computer?
What is Computer?What is Computer?
What is Computer?
 

Recently uploaded

Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
Celine George
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
Celine George
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 

Recently uploaded (20)

Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 

Cascading style sheet part 2

  • 1. COMPUTER APPLICATIONS CLASS X (Code 165) TOPIC: UNIT 2: Cascading Style Sheets – Part 2 By HIMANSHU PATHAK
  • 2. Contents • Introduction • Text styling • Web-page styling
  • 3. CSS Color • In CSS, a color can be specified by using a predefined color name or RGB or Hex values. • With CSS, a color is most often specified by: – a valid color name - like "red" – a HEX value - like "#ff0000" – an RGB value - like "rgb(255,0,0)" • we can set the color of text: – <h1 style="color : red;">Hello World</h1>
  • 4. CSS Backgrounds • You can set the background color for HTML elements: – <p style="background-color : blue;">Himanshu </p> • The opacity property specifies the transparency of an element. It can take a value from 0.0 - 1.0. • <p style=“opacity : 0.3; ">Himanshu </p> • The background-image property specifies an image to use as the background of an element. body { background-image: url("paper.gif"); }
  • 5. CSS Borders • The CSS border properties allow you to specify the style, width, and color of an element's border. • The border-style property specifies what kind of border to display. • The following values are allowed: – dotted - Defines a dotted border – dashed - Defines a dashed border – solid - Defines a solid border – double - Defines a double border
  • 6. Cont… • The border-width property specifies the width of the four borders. • The width can be set as a specific size (in px, pt, cm, em, etc) or by using one of the three pre- defined values: thin, medium, or thick. • The border-width property can have from one to four values (for the top border, right border, bottom border, and the left border) • <p style=“border-style : dotted; border-width: 5px; ”>Himanshu </p>
  • 7. Cont… • The border-color property is used to set the color of the four borders. • If border-color is not set, it inherits the color of the element. <p style=“border-style : dotted; border-width: 5px; border-color: red”>Himanshu </p>
  • 8. CSS Margins • Margins are used to create space around elements, outside of any defined borders. • There are properties for setting the margin for each side of an element (top, right, bottom, and left). • All the margin properties can have the following values: – auto - the browser calculates the margin – length - specifies a margin in px, pt, cm, etc. – % - specifies a margin in % of the width of the containing element • p { margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; } • Use the margin shorthand property with four values: • p { margin: 25px 50px 75px 100px; }
  • 9. CSS Height & Width • The height and width properties are used to set the height and width of an element. • The height and width properties do not include padding, borders, or margins. • The height and width properties may have the following values: – auto - This is default. The browser calculates the height and width – length - Defines the height/width in px, cm etc. – % - Defines the height/width in percent of the containing block – initial - Sets the height/width to its default value – inherit - The height/width will be inherited from its parent value
  • 10. Cont… • Example: <style> div { height: 200px; width: 50%; } </style>
  • 11. CSS Outline • An outline is a line that is drawn around elements, OUTSIDE the borders, to make the element "stand out". • CSS has the following outline properties: – outline-style – outline-color – outline-width • The outline-style property specifies the style of the outline, and can have one of the following values: – dotted - Defines a dotted outline – dashed - Defines a dashed outline – solid - Defines a solid outline – double - Defines a double outline
  • 12. Cont… • The outline-width property specifies the width of the outline, and can have one of the following values: – thin (typically 1px) – medium (typically 3px) – thick (typically 5px) • The outline-color property is used to set the color of the outline. – The color can be set by: • name - specify a color name, like "red" • HEX - specify a hex value, like "#ff0000" • RGB - specify a RGB value, like "rgb(255,0,0)"
  • 13. CSS Fonts • CSS Font property is used to control the look of texts. • By the use of CSS font property you can change the text size, color, style and more. • font-family: This property is used to change the face of the font. • font-size: This property is used to increase or decrease the size of the font. • font-style: This property is used to make the font bold, italic or oblique.
  • 14. CSS Font-Family • In CSS there are five generic font families: – Serif fonts have a small stroke at the edges of each letter. They create a sense of formality and elegance. – Sans-serif fonts have clean lines (no small strokes attached). They create a modern and minimalistic look. – Monospace fonts - here all the letters have the same fixed width. They create a mechanical look. – Cursive fonts imitate human handwriting. – Fantasy fonts are decorative/playful fonts. • All the different font names belong to one of the generic font families.
  • 16. Cont… • Example: <style> h1 { font-family: sans-serif; } h2 { font-family: serif; } p { font-family: monospace; } </style>
  • 17. CSS Font Size • The font-size property is used to control the size of fonts. • Possible values could be xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, size in pixels or in %. • <p style = "font-size : 20px;"> This font size is 20 pixels </p> • <p style = "font-size : small;"> This font size is small </p>
  • 18. CSS Font Style • CSS font-style property defines what type of font you want to display. • It may be italic, oblique, or normal. <style> h2 { font-style: italic; } p { font-style: oblique; } h4 { font-style: normal; } </style>
  • 19. CSS Float • The CSS float property is a positioning property. • It is used to push an element to the left or right, allowing other element to wrap around it. • It is generally used with images and layouts. • Elements are floated only horizontally. So it is possible only to float elements left or right, not up or down. • The float property can have one of the following values: left, right, none, inherit
  • 21. CSS align • The text-align property is used to set the horizontal alignment of a text. • A text can be left or right aligned, centered, or justified. • h1 { text-align: center; } h2 { text-align: left; }
  • 22. Summary • How to incorporate basic text and web page design properties using CSS. • In the next class, we will start Unit III – Cyber Ethics in detail. •Thanks