SlideShare a Scribd company logo
1 of 14
Download to read offline
CSS
Introduction
by Niciuzza, nicha.in.th
Cascading Style Sheets
=
CSS
CSS for Web Designer by Niciuzza, nicha.in.th
CSS Syntax
CSS for Web Designer by Niciuzza, nicha.in.th
CSS Comments
CSS for Web Designer by Niciuzza, nicha.in.th
A CSS comment begins with "/*", and ends with "*/"
/*This is a comment*/
p{
text-align:center;
/*This is another comment*/
color:black;
font-family:arial;
}
CSS ID
CSS for Web Designer by Niciuzza, nicha.in.th
● The id selector is used to specify a style for a single, unique element.
● The id selector uses the id attribute of the HTML element, and is defined
with a "#".
● The style rule below will be applied to the element with id="para1"
#para1{
text-align:center;
color:red;
}
<div id=”para1”></div>
style.css index.htm
CSS CLASS
CSS for Web Designer by Niciuzza, nicha.in.th
● The class selector is used to specify a style for a group of elements. Unlike
the id selector, the class selector can used on several elements.
● The class selector uses the HTML class attribute, and is defined with a "."
● Call the class in HTML element with class="center"
.center{
text-align:center;
}
<p class=”center”></p>
style.css index.htm
Three way to insert
CSS
CSS for Web Designer by Niciuzza, nicha.in.th
External Style Sheet1.
Internal Style Sheet2.
Inline Style3.
External Style Sheet
CSS for Web Designer by Niciuzza, nicha.in.th
hr {color:sienna;}
p {margin-left:20px;}
body {
background-image:url
("images/back40.gif");
}
<head>
<link rel="stylesheet"
type="text/css" href="style.
css">
</head>
<body>
…
</body>
style.css index.htm
Internal Style Sheet
CSS for Web Designer by Niciuzza, nicha.in.th
<head>
<style>
hr {color:sienna;}
p {margin-left:20px;}
body{
background-image:url("images/back40.gif");
}
</style>
</head>
index.htm
Inline Style
CSS for Web Designer by Niciuzza, nicha.in.th
<p style="color:sienna;margin-left:20px">
This is a paragraph.
</p>
index.htm
Cascaded Order
CSS for Web Designer by Niciuzza, nicha.in.th
Browser default
External style sheet
Internal style sheet
(in the head section)
Inline style
(inside an HTML element)
LOW PRIORITY
HIGH PRIORITY
Grouping Selectors
CSS for Web Designer by Niciuzza, nicha.in.th
h1{
color:green;
}
h2{
color:green;
}
p{
color:green;
}
h1, h2, p{
color:green;
}
Nesting Selectors
CSS for Web Designer by Niciuzza, nicha.in.th
<p>This paragraph has blue text, and
is center aligned.</p>
<div class="marked">
<p>This paragraph has not blue
text.</p>
</div>
<p>p elements inside a "marked"
classed element keeps the alignment
style, but has a different text
color.</p>
p{
color:blue;
text-align:center;
}
.marked{
background-color:red;
}
.marked p{
color:white;
}
References
CSS for Web Designer by Niciuzza, nicha.in.th
● http://www.w3schools.com/css/

More Related Content

What's hot (20)

Introducing CSS Grid Layout
Introducing CSS Grid LayoutIntroducing CSS Grid Layout
Introducing CSS Grid Layout
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Style and Selector
Style and SelectorStyle and Selector
Style and Selector
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Bem methodology
Bem methodologyBem methodology
Bem methodology
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 
Html
HtmlHtml
Html
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
World of CSS Grid
World of CSS GridWorld of CSS Grid
World of CSS Grid
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
CSS
CSSCSS
CSS
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 

Viewers also liked

A quest for better sleep
A quest for better sleepA quest for better sleep
A quest for better sleepAlex Martinelli
 
XP と脳梗塞
XP と脳梗塞XP と脳梗塞
XP と脳梗塞Ryo Amano
 
Деяния 9:32-42
Деяния 9:32-42Деяния 9:32-42
Деяния 9:32-42unastik
 
TOP 25 WOHNBAUTRÄGER ÖSTERREICHS
TOP 25 WOHNBAUTRÄGER ÖSTERREICHSTOP 25 WOHNBAUTRÄGER ÖSTERREICHS
TOP 25 WOHNBAUTRÄGER ÖSTERREICHSEUREB-Institute
 
Gender in the NBDC
Gender in the NBDCGender in the NBDC
Gender in the NBDCILRI
 
Putting Together the Pieces of a Successful Student Orientation
Putting Together the Pieces of a Successful Student OrientationPutting Together the Pieces of a Successful Student Orientation
Putting Together the Pieces of a Successful Student OrientationSmarterServices Owen
 
Sexy HTML with Twitter Bootstrap
Sexy HTML with Twitter BootstrapSexy HTML with Twitter Bootstrap
Sexy HTML with Twitter BootstrapKarthik Gaekwad
 
Hatada_Sebastian _softwarelibre
Hatada_Sebastian _softwarelibreHatada_Sebastian _softwarelibre
Hatada_Sebastian _softwarelibreSebastianHatada
 
Leidy carvajal actividad 1.2 mapa c
Leidy carvajal actividad 1.2 mapa cLeidy carvajal actividad 1.2 mapa c
Leidy carvajal actividad 1.2 mapa cLeidy Carvajal
 
Урок - 9, 27 февраля, 2016
Урок - 9, 27 февраля, 2016Урок - 9, 27 февраля, 2016
Урок - 9, 27 февраля, 2016Burac Constantin
 
Romeo and juliet
Romeo and julietRomeo and juliet
Romeo and julietMike Smith
 
Peep Laja, CEO, ConversionXL - How to Turn Data into Insights & Customers
Peep Laja, CEO, ConversionXL - How to Turn Data into Insights & CustomersPeep Laja, CEO, ConversionXL - How to Turn Data into Insights & Customers
Peep Laja, CEO, ConversionXL - How to Turn Data into Insights & CustomersTraction Conf
 
Romeo and Juliet
Romeo and JulietRomeo and Juliet
Romeo and Julietfartley8
 

Viewers also liked (15)

Css 2010
Css 2010Css 2010
Css 2010
 
Três porquinhos
Três porquinhosTrês porquinhos
Três porquinhos
 
A quest for better sleep
A quest for better sleepA quest for better sleep
A quest for better sleep
 
XP と脳梗塞
XP と脳梗塞XP と脳梗塞
XP と脳梗塞
 
Деяния 9:32-42
Деяния 9:32-42Деяния 9:32-42
Деяния 9:32-42
 
TOP 25 WOHNBAUTRÄGER ÖSTERREICHS
TOP 25 WOHNBAUTRÄGER ÖSTERREICHSTOP 25 WOHNBAUTRÄGER ÖSTERREICHS
TOP 25 WOHNBAUTRÄGER ÖSTERREICHS
 
Gender in the NBDC
Gender in the NBDCGender in the NBDC
Gender in the NBDC
 
Putting Together the Pieces of a Successful Student Orientation
Putting Together the Pieces of a Successful Student OrientationPutting Together the Pieces of a Successful Student Orientation
Putting Together the Pieces of a Successful Student Orientation
 
Sexy HTML with Twitter Bootstrap
Sexy HTML with Twitter BootstrapSexy HTML with Twitter Bootstrap
Sexy HTML with Twitter Bootstrap
 
Hatada_Sebastian _softwarelibre
Hatada_Sebastian _softwarelibreHatada_Sebastian _softwarelibre
Hatada_Sebastian _softwarelibre
 
Leidy carvajal actividad 1.2 mapa c
Leidy carvajal actividad 1.2 mapa cLeidy carvajal actividad 1.2 mapa c
Leidy carvajal actividad 1.2 mapa c
 
Урок - 9, 27 февраля, 2016
Урок - 9, 27 февраля, 2016Урок - 9, 27 февраля, 2016
Урок - 9, 27 февраля, 2016
 
Romeo and juliet
Romeo and julietRomeo and juliet
Romeo and juliet
 
Peep Laja, CEO, ConversionXL - How to Turn Data into Insights & Customers
Peep Laja, CEO, ConversionXL - How to Turn Data into Insights & CustomersPeep Laja, CEO, ConversionXL - How to Turn Data into Insights & Customers
Peep Laja, CEO, ConversionXL - How to Turn Data into Insights & Customers
 
Romeo and Juliet
Romeo and JulietRomeo and Juliet
Romeo and Juliet
 

Similar to Css introduction

Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.netProgrammer Blog
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssTesfaye Yenealem
 
Css for Development
Css for DevelopmentCss for Development
Css for Developmenttsengsite
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheetsCK Yang
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layoutCK Yang
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
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 For Coders
CSS For CodersCSS For Coders
CSS For Codersggfergu
 
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
 

Similar to Css introduction (20)

Css3
Css3Css3
Css3
 
Css.html
Css.htmlCss.html
Css.html
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheets
 
html-css
html-csshtml-css
html-css
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
CSS
CSSCSS
CSS
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
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 Basics
Css BasicsCss Basics
Css Basics
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
chitra
chitrachitra
chitra
 
CSS For Coders
CSS For CodersCSS For Coders
CSS For Coders
 
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)
 
Web
WebWeb
Web
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

Css introduction

  • 2. Cascading Style Sheets = CSS CSS for Web Designer by Niciuzza, nicha.in.th
  • 3. CSS Syntax CSS for Web Designer by Niciuzza, nicha.in.th
  • 4. CSS Comments CSS for Web Designer by Niciuzza, nicha.in.th A CSS comment begins with "/*", and ends with "*/" /*This is a comment*/ p{ text-align:center; /*This is another comment*/ color:black; font-family:arial; }
  • 5. CSS ID CSS for Web Designer by Niciuzza, nicha.in.th ● The id selector is used to specify a style for a single, unique element. ● The id selector uses the id attribute of the HTML element, and is defined with a "#". ● The style rule below will be applied to the element with id="para1" #para1{ text-align:center; color:red; } <div id=”para1”></div> style.css index.htm
  • 6. CSS CLASS CSS for Web Designer by Niciuzza, nicha.in.th ● The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector can used on several elements. ● The class selector uses the HTML class attribute, and is defined with a "." ● Call the class in HTML element with class="center" .center{ text-align:center; } <p class=”center”></p> style.css index.htm
  • 7. Three way to insert CSS CSS for Web Designer by Niciuzza, nicha.in.th External Style Sheet1. Internal Style Sheet2. Inline Style3.
  • 8. External Style Sheet CSS for Web Designer by Niciuzza, nicha.in.th hr {color:sienna;} p {margin-left:20px;} body { background-image:url ("images/back40.gif"); } <head> <link rel="stylesheet" type="text/css" href="style. css"> </head> <body> … </body> style.css index.htm
  • 9. Internal Style Sheet CSS for Web Designer by Niciuzza, nicha.in.th <head> <style> hr {color:sienna;} p {margin-left:20px;} body{ background-image:url("images/back40.gif"); } </style> </head> index.htm
  • 10. Inline Style CSS for Web Designer by Niciuzza, nicha.in.th <p style="color:sienna;margin-left:20px"> This is a paragraph. </p> index.htm
  • 11. Cascaded Order CSS for Web Designer by Niciuzza, nicha.in.th Browser default External style sheet Internal style sheet (in the head section) Inline style (inside an HTML element) LOW PRIORITY HIGH PRIORITY
  • 12. Grouping Selectors CSS for Web Designer by Niciuzza, nicha.in.th h1{ color:green; } h2{ color:green; } p{ color:green; } h1, h2, p{ color:green; }
  • 13. Nesting Selectors CSS for Web Designer by Niciuzza, nicha.in.th <p>This paragraph has blue text, and is center aligned.</p> <div class="marked"> <p>This paragraph has not blue text.</p> </div> <p>p elements inside a "marked" classed element keeps the alignment style, but has a different text color.</p> p{ color:blue; text-align:center; } .marked{ background-color:red; } .marked p{ color:white; }
  • 14. References CSS for Web Designer by Niciuzza, nicha.in.th ● http://www.w3schools.com/css/