SlideShare uma empresa Scribd logo
1 de 33
HTML
Concepts and Techniques
Fifth Edition
Chapter 8
Creating Style Sheets
Chapter 8: Creating Style Sheets 2
Chapter Objectives
• Describe the three different types of Cascading Style
Sheets
• Add an embedded style sheet to a Web page
• Change the margin and link styles using an embedded
style sheet
• Create an external style sheet
• Change the body margins and background using an
external style sheet
• Change the link decoration and color using an external
style sheet
Chapter 8: Creating Style Sheets 3
Chapter Objectives
• Change the font family and size for all paragraphs using
an external style sheet.
• Change table styles using an external style sheet.
• Use the <link /> tag to insert a link to an external style
sheet.
• Add an inline style sheet to a Web page.
• Change the text style of a single paragraph using an
inline style sheet.
Chapter 8: Creating Style Sheets 4
Plan Ahead – General Project Guidelines
1. Plan the Web site – if using CSS is appropriate.
2. Analyze the need or content to include on the Web
page.
3. Choose the content for the Web page
4. Determine the type of style sheets to use for the pages
and their precedence.
5. Create the style sheets.
6. Test all Web pages within the Web site.
Chapter 8: Creating Style Sheets 5
Using Style Sheets
• A style is a rule that defines the appearance of an
element on a Web page.
• A style sheet is a series of rules that defines the style
for a Web page or an entire Web site.
• With a style sheet, you can alter the appearance of a
Web page or pages by changing characteristics such as
font family, font size, margins and link specifications.
• Style sheets adhere to a common language with a
standard and rules. This language called Cascading
Style Sheets or CSS.
• CSS allows a Web developer to write code statements
that control the style of elements on a Web page.
Chapter 8: Creating Style Sheets 6
Style Sheets Precedence
• CSS provides for three types of style sheets:
– Inline style sheet
– Embedded style sheet
– External style sheets
• Table 8-1 Style Sheet Precedence
Chapter 8: Creating Style Sheets 7
Style Statement Format
• Example code for inline style sheet:
– <p style=“font-style: italic; font size: 8pt”>
• Example code for embedded style sheet:
– <style type=“text/css”>
– <!—
– p {text-indent: 8pt}
– -->
– </style>
• Example code for external style sheet:
• Save the text file with a.css extension
– a {text-decoration: none; color: blue}
– p {font-family: Verdana, Garamond; font-size: 11pt}
• Link must be inserted for external style sheet:
– <link rel=“stylesheet” type=“text/css” href=style1.css” />
Table 8-3 Files Used for Chapter8
File Name Purpose and Display
Specifics
Changes Made in
Chapter 8
index.html • Frame definition file
• Define layout of frame on the Web page
• None
menu.html • Provide links to all other web pages
• Displayed in left frame
• Add an embedded style sheet
style1.css • External style sheet that is linked to next
four pages
• Create as external style sheet
• Save as a .css file
welcome.html • Provides welcome to Web site
• Displayed in right frame
• Add link to external style sheet
• Add inline style sheet
contact.html • Lists contact information
• Displayed in right frame
• Add link to external style sheet
meetings.html • List meeting dates / topic available
• Displayed in right frame
• Add link to external style sheet
questions.html • Displays form for questions
• Displayed in right frame
• Add link to external style sheet
Chapter 8: Creating Style Sheets 8
Chapter 8: Creating Style Sheets 9
Starting Notepad
and Opening an HTML File
• With the USB drive plugged into your computer, start the
Web browser and enter G:Chapter08
ChapterFilesindex.html on the Address bar. Click the
Contact, Meetings, Questions, and Home links to view the
original Web pages provided in the Data Files for Students
• Start Notepad and, if necessary, maximize the window
• Navigate to the G:Chapter08ChapterFile folder. If
necessary, click the Files of type list arrow and then click All
Files to display the menu.html file
• Double-click menu.html in the list of files to open the file
Chapter 8: Creating Style Sheets 10
Starting Notepad
and Opening an HTML File
Chapter 8: Creating Style Sheets 11
Adding an Embedded Style Sheet
• Highlight the comment <!-- Insert embedded style
sheet here -->, on line 10 and then press the
DELETE key
• Enter the CSS code shown in Table 8–4
Chapter 8: Creating Style Sheets 12
Adding an Embedded Style Sheet
Chapter 8: Creating Style Sheets 13
Saving, Validating, and Viewing an HTML File
• With the USB drive plugged into your computer click File
on the menu bar and then click Save. If necessary, type
menu.html in the File name text box
• Validate the Web page using the W3C validation service
• Open the index.html file in the Web browser to show the
completed navigation menu as shown on the left side of
the index.html Web page
Saving, Validating, and Viewing an HTML File
Chapter 8: Creating Style Sheets 14
Printing an HTML File
and Web Page
• Print the Web page from the browser
• Click the menu.html - Notepad button on the taskbar
• Click File on the menu bar and then click Print on the
File menu
• Click the Print button in the Print dialog box to print the
HTML code
Chapter 8: Creating Style Sheets 15
Chapter 8: Creating Style Sheets 16
Printing an HTML File
and Web Page
Chapter 8: Creating Style Sheets 17
Creating an External Style Sheet
• If necessary, click the menu.html – Notepad button on the
taskbar. Click File on the menu bar and then click New
• Enter the CSS code as shown in Table 8–5 on page HTML
360
• With the USB drive plugged into your computer, click File on
the menu bar and then click Save As. Type styles1.css in
the File name text box. If necessary, navigate to the
G:Chapter08ChapterFiles folder. Click the Save button in
the Save As dialog box to save the file as styles1.css
• Click the File menu, click Print on the File menu, and then
click the Print button in the Print dialog box
Chapter 8: Creating Style Sheets 18
Creating an External Style Sheet
Chapter 8: Creating Style Sheets 19
Linking to an External Style Sheet
• If necessary, click the styles1.css – Notepad button on the taskbar
• With the USB drive plugged into your computer, click File on the
menu bar and then click Open on the File menu
• If necessary, navigate to the G:Chapter08ChapterFiles folder.
Click the Files of type box arrow, and then click All Files to show all
files in the Chapter08ChapterFiles folder. Click the contact.html
file
• Click the Open button in the Open dialog box
• Highlight the text, <!--Insert link statement here -->, in line 10
• Type <link rel=”stylesheet” type=”text/css”
href=”styles1.css” /> to enter the link to the external style
sheet
Chapter 8: Creating Style Sheets 20
Linking to an External Style Sheet
• Click File on the menu bar and then click Save on the
File menu
• Validate the Web page using the W3C service
• Open the index.html file in the browser and click the
Contact Link to see the change on the Web page
Chapter 8: Creating Style Sheets 21
Linking to an External Style Sheet
Chapter 8: Creating Style Sheets 22
Linking the Remaining HTML Files to an
External Style Sheet
• If necessary, click the contact.html - Notepad button on the
taskbar
• With the USB drive plugged into your computer, click File on
the menu bar and then click Open on the File menu
• If necessary, navigate to the G:Chapter08ChapterFiles
folder. Click the Files of type box arrow, and then click All
Files to show all files in the Chapter08ChapterFiles folder.
Click the meetings.html file
• Click the Open button in the Open dialog box
• Highlight the text, <!--Insert link statement here --> on line 10
Chapter 8: Creating Style Sheets 23
Linking the Remaining HTML Files to an
External Style Sheet
• Type <link rel=”stylesheet”
type=”text/css” href=”styles1.css” /> to
enter the link to the external style sheet
• Click File on the menu bar and then click Save on the
File menu
• Validate the Web page
• One at a time, open the HTML files questions.html and
welcome.html, and repeat bullets 5 through 8 to
replace the placeholder text with the link tag, then
save and validate the code
Chapter 8: Creating Style Sheets 24
Adding an Inline Style Sheet
• If necessary, click the welcome.html - Notepad button
on the taskbar so the file welcome.html is displayed
• Click immediately to the right of the p in the <p> tag on
line 30. Press the SPACEBAR and then type
style=”fontstyle: italic; font-size:
8pt” to insert the inline style sheet
• Click File on the menu bar and then click Save
• Validate the Web page
Chapter 8: Creating Style Sheets 25
Adding an Inline Style Sheet
Chapter 8: Creating Style Sheets 26
Viewing and Printing
Framed Web Pages
• Click the browser button on the taskbar
• Open the index.html file in the browser
• Click the File menu, and then click Print
• When the Print dialog box is displayed, click the
Options tab
• Click As laid out on screen and then click the Print
button
• One at a time, click the links, Contact, Meetings, and
Questions, and repeat bullets 3 through 5
Chapter 8: Creating Style Sheets 27
Viewing and Printing
Framed Web Pages
Chapter 8: Creating Style Sheets 28
Viewing and Printing HTML Files
• If necessary, click the Karen Stofcich Financials
browser button on the taskbar. If necessary, click the
Home link in the menu frame so the Welcome Web
page (welcome.html) is displayed in the right frame
• Right-click anywhere in the right frame except on a link
• Click View Source on the shortcut menu
• After the file welcome.html is opened in Notepad, click
the File menu, then click Print. Click the Print button in
the Print dialog box
Chapter 8: Creating Style Sheets 29
Viewing and Printing HTML Files
• Click the browser button on the taskbar, click the
Contact link, and then repeat bullets 2 through 4
• Click the browser button on the taskbar, click the
Meetings link, and then repeat bullets 2 through 4
• Click the browser button on the taskbar, click the
Questions link, and then repeat bullets 2 through 4
Chapter 8: Creating Style Sheets 30
Quitting Notepad and a Browser
• Close all open browser windows
• Click the Close button on the Notepad window title bar
Chapter 8: Creating Style Sheets 31
Chapter Summary
• Describe the three different types of Cascading Style
Sheets
• Add an embedded style sheet to a Web page
• Change the margin and link styles using an embedded
style sheet
• Create an external style sheet
• Change the body margins and background using an
external style sheet
• Change the link decoration and color using an external
style sheet
Chapter 8: Creating Style Sheets 32
Chapter Summary
• Change the font family and size for all paragraphs
using an external style sheet
• Change table styles using an external style sheet
• Use the <link /> tag to insert a link to an external style
sheet
• Add an inline style sheet to a Web page
• Change the text style of a single paragraph using an
inline style sheet
HTML
Concepts and Techniques
Fifth Edition
Chapter 8 Complete
Creating Style Sheets

Mais conteúdo relacionado

Mais procurados

Lesson 2 cs5
Lesson 2   cs5Lesson 2   cs5
Lesson 2 cs5
dtelepos
 
Introduction to html (912 kb)
Introduction to html (912 kb)Introduction to html (912 kb)
Introduction to html (912 kb)
IMRAN KHAN
 
CHILD Site Coordinator Training
CHILD Site Coordinator TrainingCHILD Site Coordinator Training
CHILD Site Coordinator Training
ehealth
 
Lesson 5 cs5
Lesson 5   cs5Lesson 5   cs5
Lesson 5 cs5
dtelepos
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical list
desaipratu10
 

Mais procurados (17)

Sw13 ch01-presentation
Sw13 ch01-presentationSw13 ch01-presentation
Sw13 ch01-presentation
 
Html introduction
Html introductionHtml introduction
Html introduction
 
Lesson 2 cs5
Lesson 2   cs5Lesson 2   cs5
Lesson 2 cs5
 
Introduction to html (912 kb)
Introduction to html (912 kb)Introduction to html (912 kb)
Introduction to html (912 kb)
 
CHILD Site Coordinator Training
CHILD Site Coordinator TrainingCHILD Site Coordinator Training
CHILD Site Coordinator Training
 
Necto 16 training 6 - web component
Necto 16 training 6 -  web componentNecto 16 training 6 -  web component
Necto 16 training 6 - web component
 
06 laboratory exercise 1
06 laboratory exercise 106 laboratory exercise 1
06 laboratory exercise 1
 
Pinnacle Cart Design documentation v1.0
Pinnacle Cart Design documentation v1.0Pinnacle Cart Design documentation v1.0
Pinnacle Cart Design documentation v1.0
 
php
phpphp
php
 
Lesson 5 cs5
Lesson 5   cs5Lesson 5   cs5
Lesson 5 cs5
 
Project 02 Creating and Editing a Web Page
Project 02 Creating and Editing a Web PageProject 02 Creating and Editing a Web Page
Project 02 Creating and Editing a Web Page
 
Different page numbers inserted in one document: A step-by-step guide
Different page numbers inserted in one document: A step-by-step guideDifferent page numbers inserted in one document: A step-by-step guide
Different page numbers inserted in one document: A step-by-step guide
 
Digital Collection Development Presentation #2
Digital Collection Development Presentation #2Digital Collection Development Presentation #2
Digital Collection Development Presentation #2
 
Practical file on web technology(html)
Practical file on web technology(html)Practical file on web technology(html)
Practical file on web technology(html)
 
Digital colldevel pt2
Digital colldevel pt2Digital colldevel pt2
Digital colldevel pt2
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical list
 
Html basics
Html basicsHtml basics
Html basics
 

Semelhante a Ddpz2613 topic8 css

Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8
Jeff Byrnes
 
Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6
Krista Lawrence
 

Semelhante a Ddpz2613 topic8 css (20)

Ddpz2613 topic6 frame
Ddpz2613 topic6 frameDdpz2613 topic6 frame
Ddpz2613 topic6 frame
 
Ddpz2613 topic4 table
Ddpz2613 topic4 tableDdpz2613 topic4 table
Ddpz2613 topic4 table
 
Ddpz2613 topic3 linking
Ddpz2613 topic3 linkingDdpz2613 topic3 linking
Ddpz2613 topic3 linking
 
Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8
 
Wiki to HTML Conversion
Wiki to HTML ConversionWiki to HTML Conversion
Wiki to HTML Conversion
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Project 06
Project 06Project 06
Project 06
 
Lecture 2 - HTML Basics
Lecture 2 - HTML BasicsLecture 2 - HTML Basics
Lecture 2 - HTML Basics
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
 
Word ch10
Word ch10Word ch10
Word ch10
 
MICROSOFT WORD 2007 FULL PRESENTATION BY sarmad khosa
MICROSOFT WORD 2007 FULL PRESENTATION BY sarmad khosaMICROSOFT WORD 2007 FULL PRESENTATION BY sarmad khosa
MICROSOFT WORD 2007 FULL PRESENTATION BY sarmad khosa
 
How to Create a Simple Webpage Using Notepad.pptx
How to Create a Simple Webpage Using Notepad.pptxHow to Create a Simple Webpage Using Notepad.pptx
How to Create a Simple Webpage Using Notepad.pptx
 
9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx
 
9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx
 
9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx
 
9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx
 
Share point 2013 Building Websites
Share point 2013 Building WebsitesShare point 2013 Building Websites
Share point 2013 Building Websites
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 

Mais de Mohamad Sahiedan (16)

Cd chap 2 - static loading
Cd   chap 2 - static loadingCd   chap 2 - static loading
Cd chap 2 - static loading
 
Ddpz2613 topic5 image
Ddpz2613 topic5 imageDdpz2613 topic5 image
Ddpz2613 topic5 image
 
Ddpz2613 topic1 introduction
Ddpz2613 topic1 introductionDdpz2613 topic1 introduction
Ddpz2613 topic1 introduction
 
Doc2
Doc2Doc2
Doc2
 
Tips tassawur islam sha
Tips tassawur islam shaTips tassawur islam sha
Tips tassawur islam sha
 
Bab 2.tauhid paksi kehidupan
Bab 2.tauhid paksi kehidupanBab 2.tauhid paksi kehidupan
Bab 2.tauhid paksi kehidupan
 
Bab 1.konsep ilmu
Bab 1.konsep ilmuBab 1.konsep ilmu
Bab 1.konsep ilmu
 
Bab 3. konsep ibadat
Bab 3. konsep ibadatBab 3. konsep ibadat
Bab 3. konsep ibadat
 
Cnc
CncCnc
Cnc
 
Chapter2
Chapter2Chapter2
Chapter2
 
Chapter1
Chapter1Chapter1
Chapter1
 
Chapter 7 automation techniques
Chapter 7  automation techniquesChapter 7  automation techniques
Chapter 7 automation techniques
 
Chapter 6 mfg systems
Chapter 6    mfg systemsChapter 6    mfg systems
Chapter 6 mfg systems
 
Chapter 3 automation devices
Chapter 3  automation devicesChapter 3  automation devices
Chapter 3 automation devices
 
Chapter 2 material handling
Chapter 2 material handlingChapter 2 material handling
Chapter 2 material handling
 
Chapter 1 introduction to automation
Chapter 1   introduction  to automationChapter 1   introduction  to automation
Chapter 1 introduction to automation
 

Ddpz2613 topic8 css

  • 1. HTML Concepts and Techniques Fifth Edition Chapter 8 Creating Style Sheets
  • 2. Chapter 8: Creating Style Sheets 2 Chapter Objectives • Describe the three different types of Cascading Style Sheets • Add an embedded style sheet to a Web page • Change the margin and link styles using an embedded style sheet • Create an external style sheet • Change the body margins and background using an external style sheet • Change the link decoration and color using an external style sheet
  • 3. Chapter 8: Creating Style Sheets 3 Chapter Objectives • Change the font family and size for all paragraphs using an external style sheet. • Change table styles using an external style sheet. • Use the <link /> tag to insert a link to an external style sheet. • Add an inline style sheet to a Web page. • Change the text style of a single paragraph using an inline style sheet.
  • 4. Chapter 8: Creating Style Sheets 4 Plan Ahead – General Project Guidelines 1. Plan the Web site – if using CSS is appropriate. 2. Analyze the need or content to include on the Web page. 3. Choose the content for the Web page 4. Determine the type of style sheets to use for the pages and their precedence. 5. Create the style sheets. 6. Test all Web pages within the Web site.
  • 5. Chapter 8: Creating Style Sheets 5 Using Style Sheets • A style is a rule that defines the appearance of an element on a Web page. • A style sheet is a series of rules that defines the style for a Web page or an entire Web site. • With a style sheet, you can alter the appearance of a Web page or pages by changing characteristics such as font family, font size, margins and link specifications. • Style sheets adhere to a common language with a standard and rules. This language called Cascading Style Sheets or CSS. • CSS allows a Web developer to write code statements that control the style of elements on a Web page.
  • 6. Chapter 8: Creating Style Sheets 6 Style Sheets Precedence • CSS provides for three types of style sheets: – Inline style sheet – Embedded style sheet – External style sheets • Table 8-1 Style Sheet Precedence
  • 7. Chapter 8: Creating Style Sheets 7 Style Statement Format • Example code for inline style sheet: – <p style=“font-style: italic; font size: 8pt”> • Example code for embedded style sheet: – <style type=“text/css”> – <!— – p {text-indent: 8pt} – --> – </style> • Example code for external style sheet: • Save the text file with a.css extension – a {text-decoration: none; color: blue} – p {font-family: Verdana, Garamond; font-size: 11pt} • Link must be inserted for external style sheet: – <link rel=“stylesheet” type=“text/css” href=style1.css” />
  • 8. Table 8-3 Files Used for Chapter8 File Name Purpose and Display Specifics Changes Made in Chapter 8 index.html • Frame definition file • Define layout of frame on the Web page • None menu.html • Provide links to all other web pages • Displayed in left frame • Add an embedded style sheet style1.css • External style sheet that is linked to next four pages • Create as external style sheet • Save as a .css file welcome.html • Provides welcome to Web site • Displayed in right frame • Add link to external style sheet • Add inline style sheet contact.html • Lists contact information • Displayed in right frame • Add link to external style sheet meetings.html • List meeting dates / topic available • Displayed in right frame • Add link to external style sheet questions.html • Displays form for questions • Displayed in right frame • Add link to external style sheet Chapter 8: Creating Style Sheets 8
  • 9. Chapter 8: Creating Style Sheets 9 Starting Notepad and Opening an HTML File • With the USB drive plugged into your computer, start the Web browser and enter G:Chapter08 ChapterFilesindex.html on the Address bar. Click the Contact, Meetings, Questions, and Home links to view the original Web pages provided in the Data Files for Students • Start Notepad and, if necessary, maximize the window • Navigate to the G:Chapter08ChapterFile folder. If necessary, click the Files of type list arrow and then click All Files to display the menu.html file • Double-click menu.html in the list of files to open the file
  • 10. Chapter 8: Creating Style Sheets 10 Starting Notepad and Opening an HTML File
  • 11. Chapter 8: Creating Style Sheets 11 Adding an Embedded Style Sheet • Highlight the comment <!-- Insert embedded style sheet here -->, on line 10 and then press the DELETE key • Enter the CSS code shown in Table 8–4
  • 12. Chapter 8: Creating Style Sheets 12 Adding an Embedded Style Sheet
  • 13. Chapter 8: Creating Style Sheets 13 Saving, Validating, and Viewing an HTML File • With the USB drive plugged into your computer click File on the menu bar and then click Save. If necessary, type menu.html in the File name text box • Validate the Web page using the W3C validation service • Open the index.html file in the Web browser to show the completed navigation menu as shown on the left side of the index.html Web page
  • 14. Saving, Validating, and Viewing an HTML File Chapter 8: Creating Style Sheets 14
  • 15. Printing an HTML File and Web Page • Print the Web page from the browser • Click the menu.html - Notepad button on the taskbar • Click File on the menu bar and then click Print on the File menu • Click the Print button in the Print dialog box to print the HTML code Chapter 8: Creating Style Sheets 15
  • 16. Chapter 8: Creating Style Sheets 16 Printing an HTML File and Web Page
  • 17. Chapter 8: Creating Style Sheets 17 Creating an External Style Sheet • If necessary, click the menu.html – Notepad button on the taskbar. Click File on the menu bar and then click New • Enter the CSS code as shown in Table 8–5 on page HTML 360 • With the USB drive plugged into your computer, click File on the menu bar and then click Save As. Type styles1.css in the File name text box. If necessary, navigate to the G:Chapter08ChapterFiles folder. Click the Save button in the Save As dialog box to save the file as styles1.css • Click the File menu, click Print on the File menu, and then click the Print button in the Print dialog box
  • 18. Chapter 8: Creating Style Sheets 18 Creating an External Style Sheet
  • 19. Chapter 8: Creating Style Sheets 19 Linking to an External Style Sheet • If necessary, click the styles1.css – Notepad button on the taskbar • With the USB drive plugged into your computer, click File on the menu bar and then click Open on the File menu • If necessary, navigate to the G:Chapter08ChapterFiles folder. Click the Files of type box arrow, and then click All Files to show all files in the Chapter08ChapterFiles folder. Click the contact.html file • Click the Open button in the Open dialog box • Highlight the text, <!--Insert link statement here -->, in line 10 • Type <link rel=”stylesheet” type=”text/css” href=”styles1.css” /> to enter the link to the external style sheet
  • 20. Chapter 8: Creating Style Sheets 20 Linking to an External Style Sheet • Click File on the menu bar and then click Save on the File menu • Validate the Web page using the W3C service • Open the index.html file in the browser and click the Contact Link to see the change on the Web page
  • 21. Chapter 8: Creating Style Sheets 21 Linking to an External Style Sheet
  • 22. Chapter 8: Creating Style Sheets 22 Linking the Remaining HTML Files to an External Style Sheet • If necessary, click the contact.html - Notepad button on the taskbar • With the USB drive plugged into your computer, click File on the menu bar and then click Open on the File menu • If necessary, navigate to the G:Chapter08ChapterFiles folder. Click the Files of type box arrow, and then click All Files to show all files in the Chapter08ChapterFiles folder. Click the meetings.html file • Click the Open button in the Open dialog box • Highlight the text, <!--Insert link statement here --> on line 10
  • 23. Chapter 8: Creating Style Sheets 23 Linking the Remaining HTML Files to an External Style Sheet • Type <link rel=”stylesheet” type=”text/css” href=”styles1.css” /> to enter the link to the external style sheet • Click File on the menu bar and then click Save on the File menu • Validate the Web page • One at a time, open the HTML files questions.html and welcome.html, and repeat bullets 5 through 8 to replace the placeholder text with the link tag, then save and validate the code
  • 24. Chapter 8: Creating Style Sheets 24 Adding an Inline Style Sheet • If necessary, click the welcome.html - Notepad button on the taskbar so the file welcome.html is displayed • Click immediately to the right of the p in the <p> tag on line 30. Press the SPACEBAR and then type style=”fontstyle: italic; font-size: 8pt” to insert the inline style sheet • Click File on the menu bar and then click Save • Validate the Web page
  • 25. Chapter 8: Creating Style Sheets 25 Adding an Inline Style Sheet
  • 26. Chapter 8: Creating Style Sheets 26 Viewing and Printing Framed Web Pages • Click the browser button on the taskbar • Open the index.html file in the browser • Click the File menu, and then click Print • When the Print dialog box is displayed, click the Options tab • Click As laid out on screen and then click the Print button • One at a time, click the links, Contact, Meetings, and Questions, and repeat bullets 3 through 5
  • 27. Chapter 8: Creating Style Sheets 27 Viewing and Printing Framed Web Pages
  • 28. Chapter 8: Creating Style Sheets 28 Viewing and Printing HTML Files • If necessary, click the Karen Stofcich Financials browser button on the taskbar. If necessary, click the Home link in the menu frame so the Welcome Web page (welcome.html) is displayed in the right frame • Right-click anywhere in the right frame except on a link • Click View Source on the shortcut menu • After the file welcome.html is opened in Notepad, click the File menu, then click Print. Click the Print button in the Print dialog box
  • 29. Chapter 8: Creating Style Sheets 29 Viewing and Printing HTML Files • Click the browser button on the taskbar, click the Contact link, and then repeat bullets 2 through 4 • Click the browser button on the taskbar, click the Meetings link, and then repeat bullets 2 through 4 • Click the browser button on the taskbar, click the Questions link, and then repeat bullets 2 through 4
  • 30. Chapter 8: Creating Style Sheets 30 Quitting Notepad and a Browser • Close all open browser windows • Click the Close button on the Notepad window title bar
  • 31. Chapter 8: Creating Style Sheets 31 Chapter Summary • Describe the three different types of Cascading Style Sheets • Add an embedded style sheet to a Web page • Change the margin and link styles using an embedded style sheet • Create an external style sheet • Change the body margins and background using an external style sheet • Change the link decoration and color using an external style sheet
  • 32. Chapter 8: Creating Style Sheets 32 Chapter Summary • Change the font family and size for all paragraphs using an external style sheet • Change table styles using an external style sheet • Use the <link /> tag to insert a link to an external style sheet • Add an inline style sheet to a Web page • Change the text style of a single paragraph using an inline style sheet
  • 33. HTML Concepts and Techniques Fifth Edition Chapter 8 Complete Creating Style Sheets