SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Cascading style sheet (css)]
Cascading style sheet (css)]Cascading style sheet (css)]
Cascading style sheet (css)]
9574395990
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
eShikshak
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Marc Steel
 

La actualidad más candente (20)

Week 12 CSS - Review from last week
Week 12 CSS - Review from last weekWeek 12 CSS - Review from last week
Week 12 CSS - Review from last week
 
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Cascading style sheet (css)]
Cascading style sheet (css)]Cascading style sheet (css)]
Cascading style sheet (css)]
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Casc Style Sheets Ii
Casc Style Sheets IiCasc Style Sheets Ii
Casc Style Sheets Ii
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)
 
Css
CssCss
Css
 
Css
CssCss
Css
 
CSS Basic Introduction, Rules, And Tips
CSS Basic Introduction, Rules, And TipsCSS Basic Introduction, Rules, And Tips
CSS Basic Introduction, Rules, And Tips
 
Turorial css
Turorial cssTurorial css
Turorial css
 
Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
 
CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)CSS Basics (Cascading Style Sheet)
CSS Basics (Cascading Style Sheet)
 
Introduction to css & its attributes with syntax
Introduction to css & its attributes with syntaxIntroduction to css & its attributes with syntax
Introduction to css & its attributes with syntax
 
Css
CssCss
Css
 

Destacado (7)

Oop concept
Oop conceptOop concept
Oop concept
 
Introduction to mysql part 6
Introduction to mysql part 6Introduction to mysql part 6
Introduction to mysql part 6
 
html 5
html 5html 5
html 5
 
образовательный математический центр «развитие» цыганков максим
образовательный математический центр «развитие» цыганков максимобразовательный математический центр «развитие» цыганков максим
образовательный математический центр «развитие» цыганков максим
 
Web Service
Web ServiceWeb Service
Web Service
 
Functions creation in sql
Functions creation in sqlFunctions creation in sql
Functions creation in sql
 
Mvc
MvcMvc
Mvc
 

Similar a Css

Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
Sónia
 
Css introduction
Css introductionCss introduction
Css introduction
Sridhar P
 
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
 
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
alvindalejoyosa1
 

Similar a Css (20)

CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
lecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptxlecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptx
 
CSS.ppt
CSS.pptCSS.ppt
CSS.ppt
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Css
CssCss
Css
 
Css introduction
Css introductionCss introduction
Css introduction
 
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...
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1
 
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
 
DHTML
DHTMLDHTML
DHTML
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introduction
 

Más de baabtra.com - No. 1 supplier of quality freshers

Más de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

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