SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados (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
 

Destaque (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
 

Semelhante a Css

CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)Saurabh Anand
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptxMattMarino13
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2Sónia
 
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.pptxzheerhimdad
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style SheetsMukesh Tekwani
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designersSingsys Pte Ltd
 
Css introduction
Css introductionCss introduction
Css introductionSridhar 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
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1jeweltutin
 
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.pptxalvindalejoyosa1
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmithaps4
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxkarthiksmart21
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmitha273566
 
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)Webtech Learning
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introductionHimanshu Pathak
 

Semelhante 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
 

Mais de baabtra.com - No. 1 supplier of quality freshers

Mais 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

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 MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
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 textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Último (20)

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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

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