CSS
Inline Style
• <tag style=”color: black; font-size: 16pt; “>text
to be styled</tag>
• Drawback: labor intensive; style is only
applied one tag at a time
What if we could apply a single style to
many tags at once?
• We can, by separating the styling code (CSS)
from the information on the page (HTML).
Method 1: Move styling to the
<head> section
Syntax:
selector {property: value; property: value;}
Or:
selector {
property: value;
property: value;
}
Example:
<head>
<style type="text/css">
p {
font-family: Verdana;
color: #000099;
font-size: 12pt;
}
h1 {
font-family: Tahoma;
color: #000;
font-size: 24pt;
font-weight: bold;
}
</style>
<head>
Method 2: Move the styling to a
separate document
Web page content: index.html
Styling: stylesheet.css
Insert a <link> tag into the <head> section of the
html file.
Example:
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
All that page contains is the selectors
and declarations
p {
font-family: Verdana;
color: #000099;
font-size: 12pt;
}
Specifying Color
• Can choose from a list of standard colors and
call them by name, but this limits you to a few
dozen “web-safe” colors.
• We can actually choose from…
16 million colors.
• color: black = color: #000000
• color: white = color: #ffffff
RGB
00 00 00
red green blue
Every digit can be one of 16 choices
(hexadecimal):
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 is no color, F is the brightest
16 million
There are two digits each for red, green, and
blue, so 16 x 16 = 256
256 red levels
256 green levels
x 256 blue levels
16,777,216
possible colors
Examples
Bright red: #ff0000
Bright green: #00ff00
Bright blue: #0000ff

More Related Content

PPT
PPTX
Web programming css
PPTX
Introduction to CSS
PPTX
Unit iii css and javascript 1
PPTX
Css introduction
PPT
CSS Introduction
PDF
The Dark Arts of CSS
PPTX
Html and css
Web programming css
Introduction to CSS
Unit iii css and javascript 1
Css introduction
CSS Introduction
The Dark Arts of CSS
Html and css

What's hot (18)

PPTX
PDF
Css few small tips and information
PPTX
PPTX
HTML and CSS
PPTX
CSS introduction
PDF
CSS3 Introduction
PPTX
Introducing the style tag 2830
PPTX
Welcome to css!
PPTX
Web development using HTML and CSS
PPTX
Html & CSS
ODP
Introduction to css & its attributes with syntax
PPT
7.2 external style sheets
PPTX
Css ms megha
PDF
An Introduction to CSS
PPTX
Html part 2
PDF
Day5
PPTX
CSS Selectors: element, class, id
Css few small tips and information
HTML and CSS
CSS introduction
CSS3 Introduction
Introducing the style tag 2830
Welcome to css!
Web development using HTML and CSS
Html & CSS
Introduction to css & its attributes with syntax
7.2 external style sheets
Css ms megha
An Introduction to CSS
Html part 2
Day5
CSS Selectors: element, class, id
Ad

Similar to CSS Basics - Stylesheets and Color (20)

PPTX
Lecture 9 CSS part 1.pptxType Classification
PPTX
Lecture 3CSS part 1.pptx
PPT
Unit 2-CSS & Bootstrap.ppt
PPTX
Lesson 110 24 aug13-1400-ay
PPT
ch04-css-basics_final.ppt
PPT
CSS Training in Bangalore
PPTX
CSS ppt of cascading Style sheet for beginners.pptx
PPTX
INTRODUCTIONS OF CSS
PDF
Intro to HTML and CSS - Class 2 Slides
PPT
Learning CSS for beginners.ppt all that are but
PPT
Chapter 3 - Web Design
PPTX
diffrent style sheets like cascading style sheets.pptx
PPTX
Module 3-Introduction to CSS (Chapter 3).pptx
PDF
4. Web Technology CSS Basics-1
PPTX
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
PPT
Css training tutorial css3 &amp; css4 essentials
PPT
css Cascading Style Sheets (CSS) - control the look and feel of your HTML doc...
PPT
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
PPT
css1.ppt
Lecture 9 CSS part 1.pptxType Classification
Lecture 3CSS part 1.pptx
Unit 2-CSS & Bootstrap.ppt
Lesson 110 24 aug13-1400-ay
ch04-css-basics_final.ppt
CSS Training in Bangalore
CSS ppt of cascading Style sheet for beginners.pptx
INTRODUCTIONS OF CSS
Intro to HTML and CSS - Class 2 Slides
Learning CSS for beginners.ppt all that are but
Chapter 3 - Web Design
diffrent style sheets like cascading style sheets.pptx
Module 3-Introduction to CSS (Chapter 3).pptx
4. Web Technology CSS Basics-1
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
Css training tutorial css3 &amp; css4 essentials
css Cascading Style Sheets (CSS) - control the look and feel of your HTML doc...
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
css1.ppt
Ad

Recently uploaded (20)

PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PPTX
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
PDF
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
PPTX
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
PDF
Introduction to c language from lecture slides
PDF
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
PDF
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
PPTX
CRM(Customer Relationship Managmnet) Presentation
PDF
Secure Java Applications against Quantum Threats
PDF
Human Computer Interaction Miterm Lesson
PDF
Advancements in abstractive text summarization: a deep learning approach
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
eBook Outline_ AI in Cybersecurity – The Future of Digital Defense.pdf
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
Introduction to c language from lecture slides
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
CRM(Customer Relationship Managmnet) Presentation
Secure Java Applications against Quantum Threats
Human Computer Interaction Miterm Lesson
Advancements in abstractive text summarization: a deep learning approach
Ebook - The Future of AI A Comprehensive Guide.pdf
Presentation - Principles of Instructional Design.pptx
eBook Outline_ AI in Cybersecurity – The Future of Digital Defense.pdf
Intravenous drug administration application for pediatric patients via augmen...
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf

CSS Basics - Stylesheets and Color

  • 1. CSS
  • 2. Inline Style • <tag style=”color: black; font-size: 16pt; “>text to be styled</tag> • Drawback: labor intensive; style is only applied one tag at a time
  • 3. What if we could apply a single style to many tags at once? • We can, by separating the styling code (CSS) from the information on the page (HTML).
  • 4. Method 1: Move styling to the <head> section Syntax: selector {property: value; property: value;} Or: selector { property: value; property: value; }
  • 5. Example: <head> <style type="text/css"> p { font-family: Verdana; color: #000099; font-size: 12pt; } h1 { font-family: Tahoma; color: #000; font-size: 24pt; font-weight: bold; } </style> <head>
  • 6. Method 2: Move the styling to a separate document Web page content: index.html Styling: stylesheet.css Insert a <link> tag into the <head> section of the html file.
  • 8. All that page contains is the selectors and declarations p { font-family: Verdana; color: #000099; font-size: 12pt; }
  • 9. Specifying Color • Can choose from a list of standard colors and call them by name, but this limits you to a few dozen “web-safe” colors. • We can actually choose from…
  • 10. 16 million colors. • color: black = color: #000000 • color: white = color: #ffffff
  • 11. RGB 00 00 00 red green blue
  • 12. Every digit can be one of 16 choices (hexadecimal): 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 is no color, F is the brightest
  • 13. 16 million There are two digits each for red, green, and blue, so 16 x 16 = 256 256 red levels 256 green levels x 256 blue levels 16,777,216 possible colors
  • 14. Examples Bright red: #ff0000 Bright green: #00ff00 Bright blue: #0000ff