SlideShare a Scribd company logo
CSS
Cascading Style sheets (CSS)
• Style Sheet
– A set of statements that specify presentation of a document.
– A powerful mechanism for adding styles.
– Styles can be assigned by the <STYLE> </STYLE> tag.
2
Cascading Style sheets (CSS)
• Features
– Separates the presentation and contents of the HTML document.
– Provide numerous attributes to create dynamic effects.
– Simple.
– Reusable.
3
Advantages
• Good control over the presentation.
• Consistency : A Standard flow, look & feel can be maintained for all pages
of a Web Site
• Ability to make global changes to all the documents from a single location.
• Reduces the time spent on maintaining HTML Document
• Less Cluttered
How do Style Sheets Work?
• Separate Section is defined to place the Style Properties of the Document
within <style> </style> tags
– Section consists of two parts
• Selectors
• Declarations
How do Style Sheets Work?
<STYLE>
P{
color: red;
}
</STYLE>
Properties
Value
Selector
Selectors
A selector identifies elements on an HTML page
• Element Selector (Type Selector)
– An Element selector matches the name of a document language element.
Eg. <H1> , <P>
• Class selectors
– With the class selector you can define different styles for the same type of HTML
element.
Eg: <H1 class=“head1”>Hello</h1>
• Contextual selectors
– For selecting tags according to condition
• Ex: If we need to select paragraph tags inside span tag
• Span p { color: blue }
Selectors
• Comments
– Comments are denoted within style sheets with the same conventions
that are used in C programming.
/* COMMENTS CANNOT BE NESTED */
• Grouping
– In order to decrease repetitious statements within style sheets, grouping
of selectors and declarations is allowed.
Eg: H1, P, TD { color: red;}
• Inheritance
– Style properties are inherited from the parent element to the child
element .
<BODY>
<H1> H1 inherits to BODY style <H1>
</BODY>
Ways of specifying styles
• Inline
• Embedded (Internal styles sheet)
• External Style sheets (Linking)
9
Ways of specifying styles
1. Inline
– Can be applied to a single occurrence of an element
– Mixes content with presentation
– Should be used sparingly
10
<P style=“color:blue; margin-right: 10px;”>
Styled paragraph
</P>
Ways of specifying styles
2. Embedded (Internal styles sheet)
– Can be used by single document.
– Enclosed within the HEAD tag.
<HEAD>
<STYLE>
HR {
color:blue
}
P {
margin-right:10px
}
</STYLE>
</HEAD>
Ways of specifying styles
3. External Style sheets (Linking)
– Style Properties are defined and placed in external files and is saved
with extension .css
– These files are then Cascaded with the HTML Documents and
properties are suitably applied.
<HEAD>
<LINK REL=“stylesheet” TYPE=“text/css” HREF=“mystyle.css”>
</HEAD>
Style properties
• Color Properties
• Background Properties
• Font Properties
• Text Properties
• Margin Properties
• Border Properties
• Classification Properties
• Position Properties
13
Background and Color Properties
Properties Values
background-attachment scroll ,fixed
background-image URL, none
background-repeat repeat, repeat-x, repeat-y, no-repeat
background-color color-rgb, color-hex,
color-name, transparent
14
• background
– background : “color” / “#rrggbb” / url(“*.gif”)
• color
– color : “color name” / “#rrggbb”
Eg. BODY{ Background:”red”;}
Font Properties
Properties Values
Font-family Arial, Monospace, ….
Font-style Normal, italic, oblique
Font-variant normal, small-caps
Font-size x-small, small, medium,large
Font-weight normal, bold, bolder, light, x-large
CSS measurements
When you manipulate text and other objects with a style sheet, you often
must specify a length or size. CSS supports measurements such as
1) inches (in) 2) centimeters (cm) 3) millimeters (mm)
4) point size (pt) 5) pixels (px)
15
Text Properties
Properties
• word-spacing
• letter-spacing
• text-decoration
• vertical-align
• text-transform
• text-align
• text-indent
Values
measurement (px/cm)
measurement (px/cm)
None, underline, overline, line-through
top,text-bottom,super,sub
none, capitalize, uppercase, lowercase
left, right, center, justify
measurement
16
End of day

More Related Content

PPTX
Introduction to CSS
PPTX
The three types of style sheet lesson two fourth quarter fourth year
PPTX
Introduction of css
PPTX
CSS Basics part One
PPTX
chitra
PPT
Cascading Style Sheet | CSS
PPTX
Session v(css)
Introduction to CSS
The three types of style sheet lesson two fourth quarter fourth year
Introduction of css
CSS Basics part One
chitra
Cascading Style Sheet | CSS
Session v(css)

What's hot (20)

PPTX
Week 12 CSS - Review from last week
PPTX
Cascading Style Sheets (CSS)
PPTX
CSS introduction
PPTX
Cascading Style Sheet
PPT
Cascading style sheet (css)]
PDF
Introduction to css
PPT
Cascading Style Sheets (CSS) help
PPTX
Introduction to CSS
PPT
Cascading Style Sheets
PPSX
Introduction to css
PPTX
CSS (Cascading Style Sheet)
PPTX
CSS Basic Introduction, Rules, And Tips
PPTX
Turorial css
PPTX
Html Styles-CSS
PPTX
CSS Basics (Cascading Style Sheet)
ODP
Introduction to css & its attributes with syntax
Week 12 CSS - Review from last week
Cascading Style Sheets (CSS)
CSS introduction
Cascading Style Sheet
Cascading style sheet (css)]
Introduction to css
Cascading Style Sheets (CSS) help
Introduction to CSS
Cascading Style Sheets
Introduction to css
CSS (Cascading Style Sheet)
CSS Basic Introduction, Rules, And Tips
Turorial css
Html Styles-CSS
CSS Basics (Cascading Style Sheet)
Introduction to css & its attributes with syntax
Ad

Viewers also liked (7)

PPTX
PPTX
образовательный математический центр «развитие» цыганков максим
образовательный математический центр «развитие» цыганков максим
Ad

Similar to Css (20)

PPTX
CSS(Cascading Stylesheet)
PPTX
BITM3730Week4.pptx
PPTX
Lecture-6.pptx
PPTX
Ifi7174 lesson2
PPTX
Cascading style sheet, CSS Box model, Table in CSS
PPTX
lecture CSS 1-2_2022_2023.pptx
PPT
PPTX
cascading style sheets- About cascading style sheets on the selectors
PPTX
Introduction to Wed System And Technologies (1).pptx
PPTX
Unit 2 WT-CSS.pptx web technology project
PDF
Cascading Style Sheets
PPTX
Beginners css tutorial for web designers
DOC
Css introduction
PPTX
Cascading Styling Sheets(CSS) simple design language intended to transform th...
PPTX
CSS tutorial chapter 1
PPT
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
PPTX
Cascading Style Sheets for web browser.pptx
PPTX
PPTX
uptu web technology unit 2 Css
CSS(Cascading Stylesheet)
BITM3730Week4.pptx
Lecture-6.pptx
Ifi7174 lesson2
Cascading style sheet, CSS Box model, Table in CSS
lecture CSS 1-2_2022_2023.pptx
cascading style sheets- About cascading style sheets on the selectors
Introduction to Wed System And Technologies (1).pptx
Unit 2 WT-CSS.pptx web technology project
Cascading Style Sheets
Beginners css tutorial for web designers
Css introduction
Cascading Styling Sheets(CSS) simple design language intended to transform th...
CSS tutorial chapter 1
CSS is the language we use to style a Web page. CSS stands for Cascading Styl...
Cascading Style Sheets for web browser.pptx
uptu web technology unit 2 Css

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server

Recently uploaded (20)

PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
REPORT: Heating appliances market in Poland 2024
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
PPTX
Belt and Road Supply Chain Finance Blockchain Solution
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
DevOps & Developer Experience Summer BBQ
PDF
Google’s NotebookLM Unveils Video Overviews
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
KodekX | Application Modernization Development
PDF
Dell Pro 14 Plus: Be better prepared for what’s coming
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Chapter 2 Digital Image Fundamentals.pdf
REPORT: Heating appliances market in Poland 2024
Enable Enterprise-Ready Security on IBM i Systems.pdf
Belt and Road Supply Chain Finance Blockchain Solution
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Understanding_Digital_Forensics_Presentation.pptx
Top Generative AI Tools for Patent Drafting in 2025.pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
DevOps & Developer Experience Summer BBQ
Google’s NotebookLM Unveils Video Overviews
madgavkar20181017ppt McKinsey Presentation.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KodekX | Application Modernization Development
Dell Pro 14 Plus: Be better prepared for what’s coming
A Day in the Life of Location Data - Turning Where into How.pdf

Css

  • 1. CSS
  • 2. Cascading Style sheets (CSS) • Style Sheet – A set of statements that specify presentation of a document. – A powerful mechanism for adding styles. – Styles can be assigned by the <STYLE> </STYLE> tag. 2
  • 3. Cascading Style sheets (CSS) • Features – Separates the presentation and contents of the HTML document. – Provide numerous attributes to create dynamic effects. – Simple. – Reusable. 3
  • 4. Advantages • Good control over the presentation. • Consistency : A Standard flow, look & feel can be maintained for all pages of a Web Site • Ability to make global changes to all the documents from a single location. • Reduces the time spent on maintaining HTML Document • Less Cluttered
  • 5. How do Style Sheets Work? • Separate Section is defined to place the Style Properties of the Document within <style> </style> tags – Section consists of two parts • Selectors • Declarations
  • 6. How do Style Sheets Work? <STYLE> P{ color: red; } </STYLE> Properties Value Selector
  • 7. Selectors A selector identifies elements on an HTML page • Element Selector (Type Selector) – An Element selector matches the name of a document language element. Eg. <H1> , <P> • Class selectors – With the class selector you can define different styles for the same type of HTML element. Eg: <H1 class=“head1”>Hello</h1> • Contextual selectors – For selecting tags according to condition • Ex: If we need to select paragraph tags inside span tag • Span p { color: blue }
  • 8. Selectors • Comments – Comments are denoted within style sheets with the same conventions that are used in C programming. /* COMMENTS CANNOT BE NESTED */ • Grouping – In order to decrease repetitious statements within style sheets, grouping of selectors and declarations is allowed. Eg: H1, P, TD { color: red;} • Inheritance – Style properties are inherited from the parent element to the child element . <BODY> <H1> H1 inherits to BODY style <H1> </BODY>
  • 9. Ways of specifying styles • Inline • Embedded (Internal styles sheet) • External Style sheets (Linking) 9
  • 10. Ways of specifying styles 1. Inline – Can be applied to a single occurrence of an element – Mixes content with presentation – Should be used sparingly 10 <P style=“color:blue; margin-right: 10px;”> Styled paragraph </P>
  • 11. Ways of specifying styles 2. Embedded (Internal styles sheet) – Can be used by single document. – Enclosed within the HEAD tag. <HEAD> <STYLE> HR { color:blue } P { margin-right:10px } </STYLE> </HEAD>
  • 12. Ways of specifying styles 3. External Style sheets (Linking) – Style Properties are defined and placed in external files and is saved with extension .css – These files are then Cascaded with the HTML Documents and properties are suitably applied. <HEAD> <LINK REL=“stylesheet” TYPE=“text/css” HREF=“mystyle.css”> </HEAD>
  • 13. Style properties • Color Properties • Background Properties • Font Properties • Text Properties • Margin Properties • Border Properties • Classification Properties • Position Properties 13
  • 14. Background and Color Properties Properties Values background-attachment scroll ,fixed background-image URL, none background-repeat repeat, repeat-x, repeat-y, no-repeat background-color color-rgb, color-hex, color-name, transparent 14 • background – background : “color” / “#rrggbb” / url(“*.gif”) • color – color : “color name” / “#rrggbb” Eg. BODY{ Background:”red”;}
  • 15. Font Properties Properties Values Font-family Arial, Monospace, …. Font-style Normal, italic, oblique Font-variant normal, small-caps Font-size x-small, small, medium,large Font-weight normal, bold, bolder, light, x-large CSS measurements When you manipulate text and other objects with a style sheet, you often must specify a length or size. CSS supports measurements such as 1) inches (in) 2) centimeters (cm) 3) millimeters (mm) 4) point size (pt) 5) pixels (px) 15
  • 16. Text Properties Properties • word-spacing • letter-spacing • text-decoration • vertical-align • text-transform • text-align • text-indent Values measurement (px/cm) measurement (px/cm) None, underline, overline, line-through top,text-bottom,super,sub none, capitalize, uppercase, lowercase left, right, center, justify measurement 16