Submit Search
Upload
Chapter3
•
Download as PPT, PDF
•
0 likes
•
324 views
DeAnna Gossett
Follow
Web Development & Design
Read less
Read more
Internet
Report
Share
Report
Share
1 of 39
Download now
Recommended
Chapter4
Chapter4
DeAnna Gossett
Chapter6
Chapter6
DeAnna Gossett
Chapter7
Chapter7
DeAnna Gossett
Chapter11
Chapter11
DeAnna Gossett
Chapter5
Chapter5
DeAnna Gossett
Chapter8
Chapter8
DeAnna Gossett
Chapter13
Chapter13
DeAnna Gossett
Chapter10
Chapter10
DeAnna Gossett
Recommended
Chapter4
Chapter4
DeAnna Gossett
Chapter6
Chapter6
DeAnna Gossett
Chapter7
Chapter7
DeAnna Gossett
Chapter11
Chapter11
DeAnna Gossett
Chapter5
Chapter5
DeAnna Gossett
Chapter8
Chapter8
DeAnna Gossett
Chapter13
Chapter13
DeAnna Gossett
Chapter10
Chapter10
DeAnna Gossett
Chapter2
Chapter2
DeAnna Gossett
Chapter9
Chapter9
DeAnna Gossett
Chapter14
Chapter14
DeAnna Gossett
Chapter1
Chapter1
DeAnna Gossett
Chapter 6 - Web Design
Chapter 6 - Web Design
tclanton4
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
Joseph Lewis
Chapter 4 - Web Design
Chapter 4 - Web Design
tclanton4
HTML5 & CSS3
HTML5 & CSS3
Ian Lintner
Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPB
Wahyu Putra
Html5
Html5
Bukhtawar Umbreen
HTML5 CSS3 Basics
HTML5 CSS3 Basics
Srinivas Tamada
Html5 and-css3-overview
Html5 and-css3-overview
Jacob Nelson
HTML5 & Friends
HTML5 & Friends
Remy Sharp
An Introduction to HTML5
An Introduction to HTML5
Steven Chipman
Introduction to Html5
Introduction to Html5
www.netgains.org
A Primer on HTML 5 - By Nick Armstrong
A Primer on HTML 5 - By Nick Armstrong
Nick Armstrong
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Shay Howe
Css, xhtml, javascript
Css, xhtml, javascript
Trần Khải Hoàng
CSS Frameworks
CSS Frameworks
Mike Crabb
05 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_2016
Rich Dron
Chapter3
Chapter3
cpashke
Web Design Chapter3
Web Design Chapter3
cpashke
More Related Content
What's hot
Chapter2
Chapter2
DeAnna Gossett
Chapter9
Chapter9
DeAnna Gossett
Chapter14
Chapter14
DeAnna Gossett
Chapter1
Chapter1
DeAnna Gossett
Chapter 6 - Web Design
Chapter 6 - Web Design
tclanton4
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
Joseph Lewis
Chapter 4 - Web Design
Chapter 4 - Web Design
tclanton4
HTML5 & CSS3
HTML5 & CSS3
Ian Lintner
Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPB
Wahyu Putra
Html5
Html5
Bukhtawar Umbreen
HTML5 CSS3 Basics
HTML5 CSS3 Basics
Srinivas Tamada
Html5 and-css3-overview
Html5 and-css3-overview
Jacob Nelson
HTML5 & Friends
HTML5 & Friends
Remy Sharp
An Introduction to HTML5
An Introduction to HTML5
Steven Chipman
Introduction to Html5
Introduction to Html5
www.netgains.org
A Primer on HTML 5 - By Nick Armstrong
A Primer on HTML 5 - By Nick Armstrong
Nick Armstrong
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Shay Howe
Css, xhtml, javascript
Css, xhtml, javascript
Trần Khải Hoàng
CSS Frameworks
CSS Frameworks
Mike Crabb
05 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_2016
Rich Dron
What's hot
(20)
Chapter2
Chapter2
Chapter9
Chapter9
Chapter14
Chapter14
Chapter1
Chapter1
Chapter 6 - Web Design
Chapter 6 - Web Design
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
Chapter 4 - Web Design
Chapter 4 - Web Design
HTML5 & CSS3
HTML5 & CSS3
Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPB
Html5
Html5
HTML5 CSS3 Basics
HTML5 CSS3 Basics
Html5 and-css3-overview
Html5 and-css3-overview
HTML5 & Friends
HTML5 & Friends
An Introduction to HTML5
An Introduction to HTML5
Introduction to Html5
Introduction to Html5
A Primer on HTML 5 - By Nick Armstrong
A Primer on HTML 5 - By Nick Armstrong
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Css, xhtml, javascript
Css, xhtml, javascript
CSS Frameworks
CSS Frameworks
05 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_2016
Similar to Chapter3
Chapter3
Chapter3
cpashke
Web Design Chapter3
Web Design Chapter3
cpashke
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder Company
Css Founder
Chapter 3 - Web Design
Chapter 3 - Web Design
tclanton4
Cis145 03 configuring-withcss
Cis145 03 configuring-withcss
Nicole77777
Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8
RohanMistry15
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1
Jyoti Yadav
Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
Css Founder.com | Cssfounder org
Css Founder.com | Cssfounder org
Css Founder
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
New Tricks
Shyam sunder Rajasthan Computer
Shyam sunder Rajasthan Computer
shyamverma305
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
casestudyhelp
Week11 Lecture: CSS
Week11 Lecture: CSS
Katherine McCurdy-Lapierre, R.G.D.
BITM3730 9-19.pptx
BITM3730 9-19.pptx
MattMarino13
BITM3730 9-20.pptx
BITM3730 9-20.pptx
MattMarino13
css-tutorial
css-tutorial
tutorialsruby
css-tutorial
css-tutorial
tutorialsruby
DHTML
DHTML
Ravinder Kamboj
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
Tanu524249
Introducing Cascading Style Sheets
Introducing Cascading Style Sheets
St. Petersburg College
Similar to Chapter3
(20)
Chapter3
Chapter3
Web Design Chapter3
Web Design Chapter3
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder Company
Chapter 3 - Web Design
Chapter 3 - Web Design
Cis145 03 configuring-withcss
Cis145 03 configuring-withcss
Advanced Web Programming Chapter 8
Advanced Web Programming Chapter 8
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1
Complete Lecture on Css presentation
Complete Lecture on Css presentation
Css Founder.com | Cssfounder org
Css Founder.com | Cssfounder org
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
Shyam sunder Rajasthan Computer
Shyam sunder Rajasthan Computer
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
Week11 Lecture: CSS
Week11 Lecture: CSS
BITM3730 9-19.pptx
BITM3730 9-19.pptx
BITM3730 9-20.pptx
BITM3730 9-20.pptx
css-tutorial
css-tutorial
css-tutorial
css-tutorial
DHTML
DHTML
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
Introducing Cascading Style Sheets
Introducing Cascading Style Sheets
More from DeAnna Gossett
Chapter12
Chapter12
DeAnna Gossett
Elet5e ch01
Elet5e ch01
DeAnna Gossett
Elet5e ch20
Elet5e ch20
DeAnna Gossett
Elet5e ch19
Elet5e ch19
DeAnna Gossett
Elet5e ch18
Elet5e ch18
DeAnna Gossett
Elet5e ch17
Elet5e ch17
DeAnna Gossett
Elet5e ch16
Elet5e ch16
DeAnna Gossett
Elet5e ch15
Elet5e ch15
DeAnna Gossett
Elet5e ch14
Elet5e ch14
DeAnna Gossett
Elet5e ch13
Elet5e ch13
DeAnna Gossett
Elet5e ch12
Elet5e ch12
DeAnna Gossett
Elet5e ch11
Elet5e ch11
DeAnna Gossett
Elet5e ch10
Elet5e ch10
DeAnna Gossett
Elet5e ch09
Elet5e ch09
DeAnna Gossett
Elet5e ch08
Elet5e ch08
DeAnna Gossett
Elet5e ch07
Elet5e ch07
DeAnna Gossett
Elet5e ch06
Elet5e ch06
DeAnna Gossett
Elet5e ch05
Elet5e ch05
DeAnna Gossett
More from DeAnna Gossett
(18)
Chapter12
Chapter12
Elet5e ch01
Elet5e ch01
Elet5e ch20
Elet5e ch20
Elet5e ch19
Elet5e ch19
Elet5e ch18
Elet5e ch18
Elet5e ch17
Elet5e ch17
Elet5e ch16
Elet5e ch16
Elet5e ch15
Elet5e ch15
Elet5e ch14
Elet5e ch14
Elet5e ch13
Elet5e ch13
Elet5e ch12
Elet5e ch12
Elet5e ch11
Elet5e ch11
Elet5e ch10
Elet5e ch10
Elet5e ch09
Elet5e ch09
Elet5e ch08
Elet5e ch08
Elet5e ch07
Elet5e ch07
Elet5e ch06
Elet5e ch06
Elet5e ch05
Elet5e ch05
Recently uploaded
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Sonam Pathan
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
Fs
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
ys8omjxb
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Person
furqan222004
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
miss dipika
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
Fs
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
zdzoqco
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Lucknow
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Excelmac1
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Sonam Pathan
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Dana Luther
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
divyansh0kumar0
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
vipmodelshub1
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
LinaWolf1
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
Fs
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
anamikaraghav4
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
rehmti665
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
z xss
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
divyansh0kumar0
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
Paul Calvano
Recently uploaded
(20)
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Person
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
Chapter3
1.
Copyright © Terry
Felke-Morris http://terrymorris.net Web Development & Design Foundations with HTML5 8th Edition CHAPTER 3 KEY CONCEPTS 1 Copyright © Terry Felke-Morris
2.
Copyright © Terry
Felke-Morris http://terrymorris.net Learning Outcomes In this chapter, you will learn how to . . . ◦ Describe the evolution of style sheets from print media to the Web ◦ List advantages of using Cascading Style Sheets ◦ Use color on web pages ◦ Create style sheets that configure common color and text properties ◦ Apply inline styles ◦ Use embedded style sheets ◦ Use external style sheets ◦ Configure element, class, id, and contextual selectors ◦ Utilize the “cascade” in CSS ◦ Validate CSS 2
3.
Copyright © Terry
Felke-Morris http://terrymorris.net Overview of Cascading Style Sheets (CSS) See what is possible with CSS: ◦ Visit http://www.csszengarden.com Style Sheets ◦ used for years in Desktop Publishing ◦ apply typographical styles and spacing to printed media CSS ◦ provides the functionality of style sheets (and much more) for web developers ◦ a flexible, cross-platform, standards-based language developed by the W3C. 3
4.
Copyright © Terry
Felke-Morris http://terrymorris.net CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate document and associated with the web page Potentially smaller documents Easier site maintenance 4
5.
Copyright © Terry
Felke-Morris http://terrymorris.net Types of Cascading Style Sheets Inline Styles Embedded Styles External Styles Imported Styles 5
6.
Copyright © Terry
Felke-Morris http://terrymorris.net Cascading Style Sheets Inline Styles ◦ body section ◦ HTML style attribute ◦ apply only to the specific element Embedded Styles ◦ head section ◦ HTML style element ◦ apply to the entire web page document External Styles ◦ Separate text file with .css file extension ◦ Associate with a HTML link element in the head section of a web page ◦ Imported Styles ◦ Similar to External Styles ◦ We’ll concentrate on the other three types of styles. 6
7.
Copyright © Terry
Felke-Morris http://terrymorris.net CSS Syntax Style sheets are composed of "Rules" that describe the styling to be applied. Each Rule contains a Selector and a Declaration 7
8.
Copyright © Terry
Felke-Morris http://terrymorris.net CSS Syntax Sample Configure a web page to display blue text and yellow background. body { color: blue; background-color: yellow; } This could also be written using hexadecimal color values as shown below. body { color: #0000FF; background-color: #FFFF00; } 8
9.
Copyright © Terry
Felke-Morris http://terrymorris.net Common Formatting CSS Properties See Table 3.1 Common CSS Properties, including: ◦ background-color ◦ color ◦ font-family ◦ font-size ◦ font-style ◦ font-weight ◦ line-height ◦ margin ◦ text-align ◦ text-decoration ◦ width 9
10.
Copyright © Terry
Felke-Morris http://terrymorris.net Using Color on Web Pages Computer monitors display color as intensities of red, green, and blue light RGB Color The values of red, green, and blue vary from 0 to 255. Hexadecimal numbers (base 16) represent these color values. 10
11.
Copyright © Terry
Felke-Morris http://terrymorris.net Hexadecimal Color Values # indicates a hexadecimal value Hex value pairs range from 00 to FF Three hex value pairs describe an RGB color #000000 black #FFFFFF white #FF0000 red #00FF00 green #0000FF blue #CCCCCC grey 11
12.
Copyright © Terry
Felke-Morris http://terrymorris.net Web Color Palette A collection of 216 colors Display the most similar on the Mac and PC platforms Hex values: 00, 33, 66, 99, CC, FF Color Chart http://webdevfoundations.net/color 12
13.
Copyright © Terry
Felke-Morris http://terrymorris.net Making Color Choices How to choose a color scheme? ◦Monochromatic ◦ http://meyerweb.com/eric/tools/color-blend ◦Choose from a photograph or other image ◦ http://www.colr.org ◦Begin with a favorite color ◦Use one of the sites below to choose other colors ◦ http://colorsontheweb.com/colorwizard.asp ◦ https://color.adobe.com/create/color-wheel ◦ http://paletton.com 13
14.
Copyright © Terry
Felke-Morris http://terrymorris.net Support Web Accessiblity Verify Sufficient Contrast When you choose colors for text and background, sufficient contrast is needed so that the text is easy to read. Use one of the following online tools to verify contrast: ◦http://webaim.org/resources/contrastchecker ◦http://snook.ca/technical/colour_contrast/colour.html ◦http://juicystudio.com/services/luminositycontrastratio.php 14
15.
Copyright © Terry
Felke-Morris http://terrymorris.net Configuring Color with Inline CSS Inline CSS ◦Configured in the body of the web page ◦Use the style attribute of an HTML tag ◦Apply only to the specific element The Style Attribute ◦Value: one or more style declaration property and value pairs Example: configure red color text in an <h1> element: <h1 style="color:#ff0000">Heading text is red</h1> 15
16.
Copyright © Terry
Felke-Morris http://terrymorris.net Configuring Color with Inline CSS (2) Example 2: configure the red text in the heading configure a gray background in the heading Separate style rule declarations with ; <h1 style="color:#FF0000;background-color:#cccccc">This is displayed as a red heading with gray background</h1> 16
17.
Copyright © Terry
Felke-Morris http://terrymorris.net CSS Embedded (Internal) Styles Configured in the head section of a web page. Use the HTML <style> element Apply to the entire web page document Style declarations are contained between the opening and closing <style> tags Example: Configure a web page with white text on a black background 17 <style> body { background-color: #000000; color: #FFFFFF; } </style>
18.
Copyright © Terry
Felke-Morris http://terrymorris.net CSS Embedded Styles <style> body { background-color: #E6E6FA; color: #191970;} h1 { background-color: #191970; color: #E6E6FA;} h2 { background-color: #AEAED4; color: #191970;} </style> 18 • The body selector sets the global style rules for the entire page. • These global rules are overridden for <h1> and <h2> elements by the h1 and h2 style rules.
19.
Copyright © Terry
Felke-Morris http://terrymorris.net Checkpoint 3.1 1. List three reasons to use CSS on a web page. 2. When designing a page that uses colors other than the default colors for text and background, explain why it is a good reason to configure style rules for both text color and background color. 3. Describe one advantage to using embedded styles instead of inline styles. 19
20.
Copyright © Terry
Felke-Morris http://terrymorris.net Configuring Text with CSS CSS properties for configuring text: ◦font-weight ◦Configures the boldness of text ◦font-style ◦Configures text to an italic style ◦font-size ◦Configures the size of the text ◦font-family ◦Configures the font typeface of the text 20
21.
Copyright © Terry
Felke-Morris http://terrymorris.net The font-size Property Accessibility Recommendation: Use em or percentage font sizes – these can be easily enlarged in all browsers by users 21
22.
Copyright © Terry
Felke-Morris http://terrymorris.net The font-family Property Not everyone has the same fonts installed in their computer Configure a list of fonts and include a generic family name p { font-family: Arial, Verdana, sans-serif; } 22
23.
Copyright © Terry
Felke-Morris http://terrymorris.net Embedded Styles Example 23 <style> body { background-color: #E6E6FA; color: #191970; font-family: Arial, Verdana, sans-serif; } h1 { background-color: #191970; color: #E6E6FA; line-height: 200%; font-family: Georgia, "Times New Roman", serif; } h2 { background-color: #AEAED4; color: #191970; text-align: center; font-family: Georgia, "Times New Roman", serif; } p {font-size: .90em; text-indent: 3em; } ul {font-weight: bold; } </style>
24.
Copyright © Terry
Felke-Morris http://terrymorris.net More CSS TEXT Properties◦line-height ◦ Configures the height of the line of text (use the value 200% to appear double-spaced) ◦text-align ◦ Configures alignment of text within a block display element ◦text-indent ◦ Configures the indentation of the first line of text ◦text-decoration ◦ Modifies the appearance of text with an underline, overline, or line-through ◦text-transform ◦ Configures the capitalization of text ◦letter-spacing ◦ Configures space between text characters ◦word-spacing ◦ Configures space between words ◦text-shadow ◦ Configures a drop shadow on text 24
25.
Copyright © Terry
Felke-Morris http://terrymorris.net CSS Selectors CSS style rules can be configured for an: ◦HTML element selector ◦class selector ◦id selector ◦descendant selector 25
26.
Copyright © Terry
Felke-Morris http://terrymorris.net Using CSS with “class” class Selector ◦Apply a CSS rule to a certain "class" of elements on a web page ◦Does not associate the style to a specific HTML element Configure with .classname ◦code CSS to create a class called “new” with red italic text. Apply the class: <p class=“new”>This is text is red and in italics</p> 26 <style> .new { color: #FF0000; font-style: italic; } </style>
27.
Copyright © Terry
Felke-Morris http://terrymorris.net Using CSS with “id” id Selector ◦Apply a CSS rule to ONE element on a web page. Configure with #idname ◦Code CSS to create an id called “new” with red, large, italic text. Apply the id: <p id=“new”>This is text is red, large, and in italics</p> 27 <style> #new { color: #FF0000; font-size:2em; font-style: italic; } </style>
28.
Copyright © Terry
Felke-Morris http://terrymorris.net Selector Specify an element within the context of its container (parent) element. AKA contextual selector The example configures a green text color only for p tags located within an element assigned to the id named content Advantage of contextual selectors: Reduces the number of classes and ids you need to apply in the HTML 28 <style> #content p { color: #00ff00; } </style>
29.
Copyright © Terry
Felke-Morris http://terrymorris.net span element Purpose: ◦configure a specially formatted area displayed in-line with other elements, such as within a paragraph. There is no additional empty space above or below a span – it is inline display. 29
30.
Copyright © Terry
Felke-Morris http://terrymorris.net span Element Example Embedded CSS: <style> .companyname { font-weight: bold; font-family: Georgia, "Times New Roman", serif; font-size: 1.25em; } </style> HTML: <p>Your needs are important to us at <span class=“companyname">Acme Web Design</span>. We will work with you to build your Web site.</p> 30
31.
Copyright © Terry
Felke-Morris http://terrymorris.net External Style Sheets - 1 CSS style rules are contained in a text file separate from the HTML documents. The External Style Sheet text file: ◦extension ".css" ◦contains only style rules ◦does not contain any HTML tags 31
32.
Copyright © Terry
Felke-Morris http://terrymorris.net body {background-color:#E6E6FA; color:#000000; font-family: Arial, sans-serif; font-size:90%; } h2 { color: #003366; } nav { font-size: 16px; font-weight: bold; } body {background-color:#E6E6FA; color:#000000; font-family: Arial, sans-serif; font-size:90%; } h2 { color: #003366; } nav { font-size: 16px; font-weight: bold; } External Style Sheets - 2 Multiple web pages can associate with the same external style sheet file. 32 site.css index.htmlindex.html clients.htmlclients.html about.htmlabout.html Etc…
33.
Copyright © Terry
Felke-Morris http://terrymorris.net link Element A self-contained tag Placed in the head section Purpose: associates the external style sheet file with the web page. Example: 33 <link rel="stylesheet" href="color.css">
34.
Copyright © Terry
Felke-Morris http://terrymorris.net Using an External Style Sheet To associate the external style sheet called color.css, the HTML code placed in the head section is: <link rel="stylesheet" href="color.css"> 34 body { background-color: #0000FF; color: #FFFFFF; } External Style Sheet color.css
35.
Copyright © Terry
Felke-Morris http://terrymorris.net Checkpoint 3.2 1. Describe a reason to use embedded styles. Explain where embedded styles are placed on a web page. 2. Describe a reason to use external styles. Explain where external styles are placed and how web pages indicate they are using external styles. 3. Write the code to configure a web page to use an external style sheet called “mystyles.css”. 35
36.
Copyright © Terry
Felke-Morris http://terrymorris.net Centering Page Content with CSS #container { margin-left: auto; margin-right: auto; width:80%; } 36
37.
Copyright © Terry
Felke-Morris http://terrymorris.net The “Cascade” 37
38.
Copyright © Terry
Felke-Morris http://terrymorris.net W3C CSS Validation http://jigsaw.w3.org/css-validator/ 38
39.
Copyright © Terry
Felke-Morris http://terrymorris.net Summary This chapter introduced you to Cascading Style Sheet Rules associated with color and text on web pages. You configured inline styles, embedded styles, and external styles. You applied CSS style rues to HTML, class, id, and descendent selectors. You are able to submit your CSS to the W3C CSS Validation test. 39
Download now