SlideShare a Scribd company logo
1 of 21
Getting Started with
CSS
Do U know these HTML Tags?
<body>I am main container</body>
<p> I am P tag </p>
<div> I am Div </div>
<span> I am Span </span>
HTML Reference
Pen for HTML
<P> or Paragraph Tag
- Paragraph tag is of type Block Content
- Special thing about <P> element is, browser will
not display more than one space character in a
row.
- It can contain other Tags/element
<div> or Division Tag
- Division tag is of type Block Content
- Division always starts on new line
- Block content tag can contain all type of inline and
block content tags
Examples of Block Content tags
<blockquote>, <p>, <ol>, <ul> etc.
<span> Tag
- Span is inline content type tag
- Does not begin with new line
- Mostly inline tags only contains inline tags
Examples of Inline tags
<b>, <strong>, <em>, <code> etc
Ways to apply CSS to HTML
Inline <p style="color: green">text</p>
Internal
<style type=”text/css”>
p{ color: green } </style>
External
mystyles.css file and content is:
p {color: green}
CSS Precedence
Browser Default (Lowest)
External Stylesheet
Internal Stylesheet
Inline Stylesheet (Highest)
The way HTML
has TAGS
CSS has SELECTORS
HTML TAG - CSS SELECTOR
How we will <p> it in
CSS?
1. #p{ }
2. :p{ }
3. p{ }
4. .p{ }
<p>
Hello Word
</p>
<div>
I am div
</div>
HTML Selectors are easy to understand as they are
just names of the HTML tags
HTML SELECTORS
<p></p>
<div></div>
<span></span>
p { }
div{ }
span{ }
Every selector has
- Curly Braces
selector always starts with curly braces { }
- Properties
Every property has a value
separated by Colon ( : ) not equal ( = )
Ends with semicolon ( ; )
SELECTORS
CSS uses many property specific units -
Codepen for units in CSS
px (pixel)
smallest and it is fixed size unit.
One pixel is equal to one dot on computer.
Pixel does not scale automatically :(
pt (point)
Used in print media.
Fixed size non-scalable
1pt = 1/72 inch
Units in CSS
Units in CSS
em
em is equal to font size of the parent element.
If parent element is 8px then that will be equal to 1em, 2em = 16px
If no font-size is defined on parent element then it is default 16px
Also em is scaleable unit. For responsive web design they are good
% (percentage)
Similar to “em”
font size = 100% e.g. 8px = 100%
completely scalable
Units in CSS
rem
Here comes new unit “root em” in css3
It works on root element <html> font-size and not on the immediate
parent size
If no font-size is defined on root element “html” then default is 16px
There are some more units - cm, in, mm etc
Colors
RGB (Red, blue, green)
Values in RGB ranges from (0 - 255)
Red - rgb(255,0,0)
Hexadecimal
Values in Hexadecimal ranges from (0 - f) i.e. (0-9 and a-f)
HSL (Hue, Saturation, lightness)
Values in HSL set like RGB (will cover this later….)
RGBa (Red, Blue, Gree, Alpha) - (will cover this later….)
CSS Color Properties
color
- Through this we specify font or border color. It is foreground color
div { color: orange; }
- Possible values for property are “
- inherit
- color value
background-color
Through this we specify the box color.
e.g. we’ll apply this property on a <div> tag, it will fill that <div> tag with
the specified background color
CSS Color Properties
background-color
div { background-color: yellow; }
- Possible values for property are
- transparent
- inherit
- color value
Pen for CSS color properties
Text Styling
To change the shape and size of the text on the web we
use multiple text properties
font-family - Basically it is the name of the font e.g. “Arial”, “Verdana”
font-size -
- Size of the font
- As learnt earlier it can use unit “px”, “pt” or “em” etc
font-weight - This will tell whether the font is bold or not
- bold
- normal
These values are supported in most of the browsers
Text Styling
font-weight -
Other than bold and normal there are other values which are supported in
new browsers
- 100, 200, 300, 400 (normal)
- (500, 600, 700) (bold)
font-style
To specify whether text style should be italic or not
- italic
- normal
Questions?
Getting started with css

More Related Content

What's hot

Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorial
bav123
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
Shawn Calvert
 

What's hot (20)

Web Design Course: CSS lecture 2
Web Design Course: CSS  lecture 2Web Design Course: CSS  lecture 2
Web Design Course: CSS lecture 2
 
Btk creative-web-03
Btk creative-web-03Btk creative-web-03
Btk creative-web-03
 
Web Design Course: CSS lecture 4
Web Design Course: CSS  lecture 4Web Design Course: CSS  lecture 4
Web Design Course: CSS lecture 4
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorial
 
Css
CssCss
Css
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Cascstylesheets
CascstylesheetsCascstylesheets
Cascstylesheets
 
Css
CssCss
Css
 
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
 
Images on the Web
Images on the WebImages on the Web
Images on the Web
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
CSS3
CSS3CSS3
CSS3
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
 
Web Design Course: CSS lecture 5
Web Design Course: CSS  lecture 5Web Design Course: CSS  lecture 5
Web Design Course: CSS lecture 5
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sass
 

Viewers also liked (7)

Facebook saludos para mis amigos crr,dic2014
Facebook saludos para mis amigos     crr,dic2014Facebook saludos para mis amigos     crr,dic2014
Facebook saludos para mis amigos crr,dic2014
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
 
[Basic HTML/CSS] 2. html - list tags
[Basic HTML/CSS] 2. html - list tags[Basic HTML/CSS] 2. html - list tags
[Basic HTML/CSS] 2. html - list tags
 
[Basic HTML/CSS] 1. html - basic tags
[Basic HTML/CSS] 1. html - basic tags[Basic HTML/CSS] 1. html - basic tags
[Basic HTML/CSS] 1. html - basic tags
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 

Similar to Getting started with css

CSS Basic and Common Errors
CSS Basic and Common ErrorsCSS Basic and Common Errors
CSS Basic and Common Errors
Hock Leng PUAH
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
sanjay2211
 

Similar to Getting started with css (20)

CSS
CSSCSS
CSS
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 
Html 2
Html   2Html   2
Html 2
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
 
CSS Basic and Common Errors
CSS Basic and Common ErrorsCSS Basic and Common Errors
CSS Basic and Common Errors
 
Webpage style with CSS
Webpage style with CSSWebpage style with CSS
Webpage style with CSS
 
CSS notes
CSS notesCSS notes
CSS notes
 
CSS
CSSCSS
CSS
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
Basic css
Basic cssBasic css
Basic css
 
Introduction to css part1
Introduction to css part1Introduction to css part1
Introduction to css part1
 
CSS Cascade Style Sheet
CSS Cascade Style SheetCSS Cascade Style Sheet
CSS Cascade Style Sheet
 
Session ii(html)
Session ii(html)Session ii(html)
Session ii(html)
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
 
Sass Essentials
Sass EssentialsSass Essentials
Sass Essentials
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Getting started with css

  • 2. Do U know these HTML Tags? <body>I am main container</body> <p> I am P tag </p> <div> I am Div </div> <span> I am Span </span> HTML Reference Pen for HTML
  • 3. <P> or Paragraph Tag - Paragraph tag is of type Block Content - Special thing about <P> element is, browser will not display more than one space character in a row. - It can contain other Tags/element
  • 4. <div> or Division Tag - Division tag is of type Block Content - Division always starts on new line - Block content tag can contain all type of inline and block content tags Examples of Block Content tags <blockquote>, <p>, <ol>, <ul> etc.
  • 5. <span> Tag - Span is inline content type tag - Does not begin with new line - Mostly inline tags only contains inline tags Examples of Inline tags <b>, <strong>, <em>, <code> etc
  • 6. Ways to apply CSS to HTML Inline <p style="color: green">text</p> Internal <style type=”text/css”> p{ color: green } </style> External mystyles.css file and content is: p {color: green}
  • 7. CSS Precedence Browser Default (Lowest) External Stylesheet Internal Stylesheet Inline Stylesheet (Highest)
  • 8. The way HTML has TAGS CSS has SELECTORS
  • 9. HTML TAG - CSS SELECTOR How we will <p> it in CSS? 1. #p{ } 2. :p{ } 3. p{ } 4. .p{ } <p> Hello Word </p> <div> I am div </div>
  • 10. HTML Selectors are easy to understand as they are just names of the HTML tags HTML SELECTORS <p></p> <div></div> <span></span> p { } div{ } span{ }
  • 11. Every selector has - Curly Braces selector always starts with curly braces { } - Properties Every property has a value separated by Colon ( : ) not equal ( = ) Ends with semicolon ( ; ) SELECTORS
  • 12. CSS uses many property specific units - Codepen for units in CSS px (pixel) smallest and it is fixed size unit. One pixel is equal to one dot on computer. Pixel does not scale automatically :( pt (point) Used in print media. Fixed size non-scalable 1pt = 1/72 inch Units in CSS
  • 13. Units in CSS em em is equal to font size of the parent element. If parent element is 8px then that will be equal to 1em, 2em = 16px If no font-size is defined on parent element then it is default 16px Also em is scaleable unit. For responsive web design they are good % (percentage) Similar to “em” font size = 100% e.g. 8px = 100% completely scalable
  • 14. Units in CSS rem Here comes new unit “root em” in css3 It works on root element <html> font-size and not on the immediate parent size If no font-size is defined on root element “html” then default is 16px There are some more units - cm, in, mm etc
  • 15. Colors RGB (Red, blue, green) Values in RGB ranges from (0 - 255) Red - rgb(255,0,0) Hexadecimal Values in Hexadecimal ranges from (0 - f) i.e. (0-9 and a-f) HSL (Hue, Saturation, lightness) Values in HSL set like RGB (will cover this later….) RGBa (Red, Blue, Gree, Alpha) - (will cover this later….)
  • 16. CSS Color Properties color - Through this we specify font or border color. It is foreground color div { color: orange; } - Possible values for property are “ - inherit - color value background-color Through this we specify the box color. e.g. we’ll apply this property on a <div> tag, it will fill that <div> tag with the specified background color
  • 17. CSS Color Properties background-color div { background-color: yellow; } - Possible values for property are - transparent - inherit - color value Pen for CSS color properties
  • 18. Text Styling To change the shape and size of the text on the web we use multiple text properties font-family - Basically it is the name of the font e.g. “Arial”, “Verdana” font-size - - Size of the font - As learnt earlier it can use unit “px”, “pt” or “em” etc font-weight - This will tell whether the font is bold or not - bold - normal These values are supported in most of the browsers
  • 19. Text Styling font-weight - Other than bold and normal there are other values which are supported in new browsers - 100, 200, 300, 400 (normal) - (500, 600, 700) (bold) font-style To specify whether text style should be italic or not - italic - normal