Tự học HTML và CSS trong 1 giờ - part 1 - Pdf 16

ptg
Download from www.wowebook.com
ptg
in One Hour aDay
Web Publishing with
HTML and CSS
Sams Teach Yourself
Laura Lemay
Rafe Colburn
800 East 96th Street, Indianapolis, Indiana 46240
Download from www.wowebook.com
ptg
Sams Teach Yourself Web Publishing with HTML
and CSS in One Hour a Day
Copyright © 2011 by Sams Publishing
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system,
or transmitted by any means, electronic, mechanical, photocopying, recording, or other-
wise, without written permission from the publisher. No patent liability is assumed with
respect to the use of the information contained herein. Although every precaution has been
taken in the preparation of this book, the publisher and authors assume no responsibility for
errors or omissions. Nor is any liability assumed for damages resulting from the use of the
information contained herein.
ISBN-13: 978-0-672-33096-4
ISBN-10: 0-672-33096-2
Library of Congress Catalog-in-Publication data is on file.
First Printing: August 2010
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have
been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this infor-
mation. Use of a term in this book should not be regarded as affecting the validity of any
trademark or service mark.

Technical Editor
Julie Meloni
Publishing
Coordinator
Vanessa Evans
Multimedia
Developer
Dan Scherf
Book Designer
Gary Adair
Page Layout
Studio Galou, LLC
Download from www.wowebook.com
ptg
Contents at a Glance
PART I: Getting Started
1 Navigating the World Wide Web 7
2 Preparing to Publish on the Web 25
3 Introducing HTML and XHTML 49
PART II: Creating Web Pages
4 Learning the Basics of HTML 67
5 Organizing Information with Lists 81
6 Adding Links to Your Web Pages 99
7 Formatting Text with HTML and CSS 131
PART III: Doing More with HTML and CSS
8 Using CSS to Style a Site 173
9 Adding Images, Color, and Backgrounds 211
10 Building Tables 259
11 Designing Forms 311
12 Integrating Multimedia: Sound, Video, and More 355

Special Fonts
5
Workshop
5
PART I: Getting Started
LESSON 1: Navigating the World Wide Web 7
How the World Wide Web Works 8
The Web Is a Hypertext Information System
8
The Web Is Graphical and Easy to Navigate
9
The Web Is Cross-Platform
10
The Web Is Distributed
10
The Web Is Dynamic
11
The Web Is Interactive
13
Web Browsers
15
What the Browser Does
15
An Overview of Some Popular Browsers
16
Using the Browser to Access Other Services
18
Web Servers
19
Uniform Resource Locators

36
Combination of Linear and Hierarchical
38
Web
39
Storyboarding Your Website
42
What’s Storyboarding and Why Do I Need It?
42
Hints for Storyboarding
43
Web Hosting
44
Using a Content-Management Application
44
Setting Up Your Own Web Hosting
45
Summary
46
Workshop
47
Q&A
47
Quiz
48
Quiz Answers
48
Exercises
48
LESSON 3: Introducing HTML and XHTML 49

Q&A
64
Quiz
65
Quiz Answers
65
Exercises
65
PART II: Creating Web Pages
LESSON 4: Learning the Basics of HTML 67
Structuring Your HTML 68
The <html> Tag
68
The <head> Tag
69
The <body> Tag
69
The Title
70
Headings
72
Paragraphs
75
Comments
75
Summary
78
Workshop
78
Q&A

ptg
Q&A 96
Quiz
97
Quiz Answers
97
Exercises
98
LESSON 6: Adding Links to Your Web Pages 99
Creating Links 100
The Link Tag: <a>
100
Linking Local Pages Using Relative and Absolute Pathnames
105
Absolute Pathnames
106
Using Relative or Absolute Pathnames?
107
Links to Other Documents on the Web
108
Linking to Specific Places Within Documents
113
Creating Links and Anchors
113
Linking to Anchors in the Same Document
120
Anatomy of a URL
120
Parts of URLs
121

Logical Styles
132
Physical Styles
135
Contents
vii
Download from www.wowebook.com
ptg
Character Formatting Using CSS 137
The Text Decoration Property
137
Font Properties
138
Preformatted Text
139
Horizontal Rules
142
Attributes of the <hr> Tag
143
Line Break
145
Addresses
147
Quotations
147
Special Characters
149
Character Entities for Special Characters
150
Specifying Character Encoding

Selectors
176
Contextual Selectors
176
Classes and IDs
177
What Cascading Means
179
Units of Measure
180
The Box Model
182
Borders
183
viii
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Download from www.wowebook.com
ptg
Margins and Padding 185
Controlling Size and Element Display
189
Float
192
CSS Positioning
196
Relative Positioning
197
Absolute Positioning
199
Controlling Stacking

215
Images and Text
219
Text and Image Alignment
220
Wrapping Text Next to Images
223
Adjusting the Space Around Images
226
Images and Links
228
Other Neat Tricks with Images
232
Image Dimensions and Scaling
232
More About Image Borders
233
Using Color
234
Specifying Colors
234
Changing Colors Using CSS
236
Changing Page Colors in HTML
236
Contents
ix
Download from www.wowebook.com


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status