Tải bản đầy đủ (.pdf) (391 trang)

Tài liệu Foundations of Microsoft Expression Web docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (13.65 MB, 391 trang )

this print for content only—size & color not accurate spine = 0.911" 392 page count
Books for professionals By professionals
®
Foundations of Microsoft Expression Web:
The Basics and Beyond
Dear Reader,
This book is about how to use Microsoft Expression Web to rapidly create a
usable, attractive website that “just works.”
An effective website needs to work in a variety of web browsers and be
usable and accessible to a wide range of users, as well as being functionally and
stylistically sound. Using standards-compliant HTML and CSS is the best way
to accomplish that goal, and Expression Web allows you to implement these
technologies easily and effectively. I wrote this book because I am excited to see
a web design tool that writes clean, valid code a professional web designer can
be proud of that also makes web design quicker, more efficient, and easier to
pick up for beginners.
This book gives you the lowdown on Expression Web, including installation,
first steps, the basics of CSS and HTML, and more advanced topics such as
Dynamic Web Templates (DWTs), Master Pages, and ASP.NET functionality.
I wanted to give newcomers to the world of web design a head start towards
creating well designed websites that make use of current best practices (includ-
ing usability, accessibility, and web standards), while not talking down to more
experienced users who want to quickly come to grips with using Expression
Web to speed up their work.
Readers of this book will take away skills needed to effectively use the
Expression Web toolbox to construct beautiful, functional websites that match
their intended purpose—websites they can be proud of.
Cheryl D. Wise
Microsoft Most Valuable Professional Expression Web
Guild of Accessible Web Designers
World Organization of Webmasters Certified Professional Web Developer


Author of
Introduction to Web Design
with FrontPage 2003
US $39.99
Shelve in
Web Development
User level:
Beginner–Intermediate
Wise
Expression Web
The eXperT’s Voice
®
in WeB DeVelopmenT
Foundations of
Microsoft
Expression Web
The Basics and Beyond
cyan
maGenTa
yelloW
Black
panTone 123 c
Cheryl D. Wise
Companion
eBook Available
www.apress.com
SOURCE CODE ONLINE
Companion eBook

See last page for details

on $10 eBook version
ISBN-13: 978-1-59059-805-4
ISBN-10: 1-59059-805-9
9 781590 598054
5 3 9 9 9
Create standards-compliant CSS and HTML
web sites with Microsoft Expression Web
RELATED TITLES

Foundations of
Microsoft
Cheryl D. Wise
Foundations of
Microsoft
Expression Web
The Basics and Beyond
8059fm.qxd 4/10/07 9:00 AM Page i
Foundations of Microsoft Expression Web: The Basics and Beyond
Copyright © 2007 by Cheryl D. Wise
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-805-4
ISBN-10 (pbk): 1-59059-805-9
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editors: Chris Mills, Matthew Moodie
Technical Reviewer: Kathleen Anderson

Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick,
Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Jeff Pepper, Paul Sarknas,
Dominic Shakeshaft, Jim Sumser, Matt Wade
Project Manager: Beth Christmas
Copy Edit Manager: Nicole Flores
Copy Editors: Heather Lang, Kim Wimpsett
Assistant Production Director: Kari Brooks-Copony
Production Editor: Katie Stence
Compositor: Molly Sharp
Proofreaders: Lori Bring, Linda Seifert
Indexer: Toma Mulligan
Artist: April Milne
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail , or
visit .
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley,
CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail , or visit .
The information in this book is distributed on an “as is” basis, without warranty. Although every precau-
tion has been taken in the preparation of this work, neither the author(s) nor Apress shall have any
liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly
or indirectly by the information contained in this work.
The source code for this book is available to readers at in the Source Code/Download
section. You will need to answer questions pertaining to this book in order to successfully download the code.
8059fm.qxd 4/10/07 9:00 AM Page ii
This book is dedicated to my husband Steve and our two children,
who were supportive even when writing this book interfered with our family life.
8059fm.qxd 4/10/07 9:00 AM Page iii
8059fm.qxd 4/10/07 9:00 AM Page iv

Contents at a Glance
About the Author
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
About the Technical Reviewer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Acknowledgments
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

CHAPTER 1 Before You Begin
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

CHAPTER 2 Taking Your First Steps
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

CHAPTER 3 Starting Off Right: Configuring Expression Web
. . . . . . . . . . . . . . . . . 47

CHAPTER 4 Using Semantic, Structured HTML to Create Web Pages
. . . . . . . . . 83

CHAPTER 5 Essential CSS: What You Need to Know
. . . . . . . . . . . . . . . . . . . . . . . . 107

CHAPTER 6 Using Expression Web to Create Basic CSS
. . . . . . . . . . . . . . . . . . . . 147

CHAPTER 7 CSS Positioning Using Expression Web Style Tools
. . . . . . . . . . . . . 171


CHAPTER 8 Branding Your Website
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

CHAPTER 9 Dynamic Web Templates
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

CHAPTER 10 Forms
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257

CHAPTER 11 Legal and Usability Issues
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

CHAPTER 12 Master Pages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297

CHAPTER 13 Beyond the Basics in CSS and Scripting
. . . . . . . . . . . . . . . . . . . . . . . 313

APPENDIX Extending Expression Web with Add-Ons
. . . . . . . . . . . . . . . . . . . . . . 347

INDEX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
v
8059fm.qxd 4/10/07 9:00 AM Page v
8059fm.qxd 4/10/07 9:00 AM Page vi
Contents
About the Author
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

About the Technical Reviewer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Acknowledgments
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

CHAPTER 1
Before You Begin
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Why Are You Creating a Website?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Typical Website Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Personal Sites
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Business Sites
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Attracting the Site Visitors You Want
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Picture Your Target Visitor
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Content Equals Credibility
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Keep Your List Simple
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Points to Ponder
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Choosing a Domain Name
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Personal Site
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Business Site
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Web Hosting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Hosting Using a Subdomain Name
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Commercial Web Hosting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
A Word About Web Servers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
What to Look for in a Web Host
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Simple Rules for All Websites
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Installing Expression Web
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Choosing Your Install Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Taking Your First Look at Expression Web
. . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
vii
8059fm.qxd 4/10/07 9:00 AM Page vii

CHAPTER 2
Taking Your First Steps
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Creating a Local Website
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
File Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Edit Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
View Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Insert Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Format Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

CHAPTER 3
Starting Off Right: Configuring Expression Web
. . . . . . . . . . 47
Using the Tools Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
General Tools Section
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Reports Section
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Optimize HTML Selection
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Program Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Preferences Section
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Using the Site Menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Folders
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Remote Web Site
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Reports
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Hyperlinks
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Recalculate Hyperlinks
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Site Settings
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

CHAPTER 4
Using Semantic, Structured HTML to Create Web Pages
. . . 83
Required Elements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Structuring Your Web Page
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Lists
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Tables
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Other HTML Elements from the Drop-Down List
. . . . . . . . . . . . . . . . 96

Hyperlinks
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
The Importance of Hidden Elements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

CONTENTSviii
8059fm.qxd 4/10/07 9:00 AM Page viii

CHAPTER 5
Essential CSS: What You Need to Know
. . . . . . . . . . . . . . . . . . 107
What Is CSS?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Why Use Stylesheets?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Types of Styles
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
C for Cascade
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Class and ID
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
<div> and <span>
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Setting Properties and Values
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Page Elements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Margin and Padding

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Color
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Background Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Hyperlinks and Pseudo-Classes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Applying a Declaration to a Group of Selectors
. . . . . . . . . . . . . . . . 135
Fonts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Box Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Changing the Document Flow with CSS
. . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Floats
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Position Absolute
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Position Relative
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

CHAPTER 6
Using Expression Web to Create Basic CSS
. . . . . . . . . . . . . . 147
Creating New Styles
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Using the Block Category

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Setting the Background
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Creating a Border
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Creating a Box
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Creating Tables
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

CHAPTER 7
CSS Positioning Using Expression Web Style Tools
. . . . . . 171
Creating the Initial Page
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Working with the Positioning Category
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Working with the Layout Category
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Lists
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Building a Page Layout
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

CONTENTS ix
8059fm.qxd 4/10/07 9:00 AM Page ix


CHAPTER 8
Branding Your Website
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Choosing a Color Scheme
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Complementary Color Schemes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Analogous Color Schemes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Monochromatic Color Schemes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Choosing Images for Your Site
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Graphics
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Photos
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Stock Photos
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Image Formats
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Adding Images to Your Web Pages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Establishing Your Look and Feel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Maintaining Your Branding Throughout Your Site
. . . . . . . . . . . . . . . 230
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231


CHAPTER 9
Dynamic Web Templates
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
DWT Overview
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
What Does a DWT Do?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Creating the DWT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Adding Editable Regions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Editable Regions in the <head> Section
. . . . . . . . . . . . . . . . . . . . . . 238
Attaching DWTs to Your Web Pages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Attaching a DWT to an Existing Page
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Preparing an Existing Page for a DWT
. . . . . . . . . . . . . . . . . . . . . . . . 245
Applying a DWT to a Page with Content
. . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Moving Content Between Editable Regions
. . . . . . . . . . . . . . . . . . . . 249
After the Template Has Been Applied
. . . . . . . . . . . . . . . . . . . . . . . . . 250
Editing a DWT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Detaching a Page from a DWT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

Changing the Attached DWT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255

CHAPTER 10
Forms
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Required Elements for a Form
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Processing Forms
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Setting Form Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
ASP Send with CDO
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
PHP Send Mail
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
ASP.NET 2.0 Form Controls
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286

CONTENTSx
8059fm.qxd 4/10/07 9:00 AM Page x

CHAPTER 11
Legal and Usability Issues
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Legal Issues

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Accessibility
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Copyright
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Privacy
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Licensing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Usability
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Usability Testing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Where Can You Find Testers?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Using Expression Reports
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Hyperlink Reports
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Site Reports
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

CHAPTER 12
Master Pages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Creating a Master Page
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Nesting Master Pages

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312

CHAPTER 13
Beyond the Basics in CSS and Scripting
. . . . . . . . . . . . . . . . . 313
Alternative Stylesheet Types
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Applying Different Media Types
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Print Stylesheets
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Validating your Forms
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
ASP.NET Form Validation Controls
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
ASP.NET Validation Controls Tag Properties
. . . . . . . . . . . . . . . . . . . . 321
HTML Forms Validation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Password Protecting a Folder
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Creating a web.config File
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Summary
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

APPENDIX
Extending Expression Web with Add-Ons

. . . . . . . . . . . . . . . . 347
Adding PayPal Buttons
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Adding Form Tools
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Keyboard Shortcuts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350

INDEX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355

CONTENTS xi
8059fm.qxd 4/10/07 9:00 AM Page xi
8059fm.qxd 4/10/07 9:00 AM Page xii
About the Author

CHERYL D. WISE, founder and director of WiserWays, LLC, has been creating
websites since 1994. A member of the Guild of Accessible Web Designers
and a World Organization of Webmasters Certified Professional Web Devel-
oper, Cheryl first received the Most Valuable Professional (MVP) award
from Microsoft for FrontPage in 2003 and received the award every year
until 2007. In 2007, Cheryl’s MVP award competency from Microsoft was
changed from FrontPage to Expression Web. She teaches others to create
standards compliant–accessible websites at Start to Web () and has
been doing other online training since 2004.
She is also the author of Introduction to Web Design with FrontPage 2003 (WiserWays:
Houston, 2005) and is the owner of one of the best Expression Web resource sites on the
Web—. You can contact her there.
xiii
8059fm.qxd 4/10/07 9:00 AM Page xiii

8059fm.qxd 4/10/07 9:00 AM Page xiv
About the Technical Reviewer

KATHLEEN ANDERSON is a Microsoft MVP for FrontPage. She was the first
woman to be honored with the FrontPage MVP award and is very happy
that she is no longer the only one.
Kathleen has been using FrontPage for ten years and is known as the
“FrontPage Database Wizard Queen” by her fellow FrontPage MVPs. She
chairs the State of Connecticut’s Committee on Web Site Accessibility. She
loves to teach people how to make accessible web sites with FrontPage and
is looking forward to doing the same with Expression Web.
xv
8059fm.qxd 4/10/07 9:00 AM Page xv
8059fm.qxd 4/10/07 9:00 AM Page xvi
Acknowledgments
I
’d like to acknowledge Tina Clarke, a fellow Microsoft FrontPage MVP and prolific e-book
writer who encouraged me to write this book and nagged me to complete it. Tina’s support
and constructive criticism helped make this book possible. Thanks also go to Pat Geary,
Echo Swinford, and Sue Forrester for their encouragement and feedback; and to my editors
at Apress, who were patient when my workflow didn’t match their standard editorial process.
xvii
8059fm.qxd 4/10/07 9:00 AM Page xvii
8059fm.qxd 4/10/07 9:00 AM Page xviii
d8b3179c1f3a5539ae0a590d20d3a408
Introduction
T
his book is about more than just Microsoft Expression Web. For most people, a web editor
is a means to an end—that end being a website that establishes a web presence. My goal in
writing this book is for you to be able to use Expression Web to do more than just establish a

presence: my hope is that you will be able to use Expression Web to create a website that ful-
fills the site owner’s goals.
The days of being able to create a website that only works in one dominant web browser
or on Windows-based computers are gone. Today, a website must look good and function prop-
erly in a variety of web browsers running on Windows and Macs. In addition, many people are
using other devices such as game consoles, PDAs, and cell phones to access the Internet. Your
website must function in each of these. This is what the term “cross browser” means. Web stan-
dards are what make it possible for your cross-browser website to work on the wide variety of
devices and browsers out there.
What Is Expression Web?
Expression Web is a new web editor from Microsoft built with web standards and cross-browser
output as its primary focuses. Unlike older web editors, Expression Web was not compelled to
work around the limitations of earlier versions with proprietary browser output and bloated
code. Instead, Microsoft has created a modern web editor that meets the needs of today’s Web.
Web 2.0 sites are frequently updated and standards compliant, and employ user-friendly inter-
faces that provide a clear, well-organized, and visually appealing site.
Expression Web was designed to create standards-complaint websites out of the box, while
at the same time providing tools to help effectively manage the look and feel of your website.
Cascading Style Sheets (CSS), Dynamic Web Templates (DWT), and ASP.NET Master Pages are
the foundation for creating and managing your website in Expression Web. Expression Web
assists you in creating standards-complaint sites by writing the code to the specification of your
choice, but it will not rewrite your code if you choose to use browser-specific code.
Why This Book?
Many people whether they are new to creating websites or started creating them in the 1990s
lack a foundation in web standards and CSS. Since Expression Web is focused on web standards
and creating cross-browser websites, you must understand the basics of structured HTML and
CSS to use its full potential. The early chapters of this book aim to give you the foundation you
need to understand and use the tools in Expression Web to create and apply CSS.
Learning how to use a web editor without understanding how websites work will leave
you with a less-than-satisfying website. In this book, I explain not just the how to use features

in Expression Web but why you should or should not use some of those features. Along the
way, topics such as accessibility and usability will be introduced and explored.
xix
8059fm.qxd 4/10/07 9:00 AM Page xix
Once you have that foundation, the book moves on to more advanced topics of creating
robust page layouts that work in a variety of web browsers, handling legacy browser issues,
and creating contact forms By the time you reach the end of the book, validating your forms
and sending the results by e-mail, creating print stylesheets, and password protecting a sec-
tion of your site will all be within your capabilities.
What Is Not in This Book?
This book is not a manual. To cover every possible thing you can do with Expression Web
would require a much longer book than this one. When you find a feature in Expression Web
in this book, it will be for a real-world purpose.
Who Is This Book For?
This book is for the web designer, not for the web developer. While this book does contain
sample form–to–e-mail scripts in three server-side languages and simple form field validation
and password protection scripts, this book does not go in-depth on the ASP.NET controls in
the Toolbox. Instead, this book focuses on the design and maintenance of websites. Microsoft
Expression Web is a tool that will make some aspects of creating a website easier—it is not a
substitute for understanding how websites work. With this book, you will learn both the tools
and the fundamentals of creating websites.
How Is This Book Structured?
The best way to learn to create a website using any program is to actually use it, which is
why each chapter includes exercises designed to reinforce the topics it explains. I recom-
mend working through each of these exercises for hands-on experience. Working examples
of the completed exercises can be viewed at , and
the complete source code can also be obtained from in the Source
Code/Download section. Sidebars will provide you with explanations of concepts and best
practice tips for creating your website.
Where Can I Find More Information?

Expression Web is a new program; as a result, features and bugs are still being discovered. If you
have questions about something you find or don’t find in the program, there are a few places I rec-
ommend checking: my site and the Microsoft Public Newsgroup/Forum
(news://msnews.microsoft.com/microsoft.public.expression.webdesigner in Outlook Express
or Windows Mail). Since URLs may change, a list of links to other places on the Web with Expres-
sion Web resources will be maintained at />■
INTRODUCTIONxx
8059fm.qxd 4/10/07 9:00 AM Page xx
Before You Begin
A
s great as the temptation is to jump right in and start creating your website, you should do
a few things first, in order to make sure the site you create is effective.
Web standards are important, but planning is even more important to the success of your
website. If you do not have a clear vision of your site goals or know which of the many goals
you have are most important, how can you expect your visitors to understand and share in
your vision and enthusiasm?
In this chapter, we will determine your site needs and follow through with site planning,
which will make creating and maintaining your site easier. You will also install Expression Web
and become familiar with its interface.
Why Are You Creating a Website?
Every website has a purpose. It must fulfill a need, whether that need is to sell a product, pro-
mote your business, provide support for a product, interact with or create a community of
people with a shared interest or passion, or simply express yourself—to share your views, art,
and so forth.
While many people think of a website as a design or a set of features, that is approaching
your site from the wrong direction. Start with what you want your site to achieve instead of
with a set of features you think you want. You may have watched home-improvement shows
like Mission: Organization or Clean Sweep. You look at the “before” picture and think, “How
could that mess have happened?” It could easily happen to your website.
In your excitement to get your website up, it’s tempting to just begin. Don’t do it—starting

to create a site without proper preparation can prove to be a big mistake when your site grows
out of control with no clear purpose. Take time to jot down your thoughts about each of the
topics in this section.

Note
Start by setting out your vision: what do you or your clients want the site to accomplish?
In addition to determining the purpose of your site, you need to know who your website’s
target audience is. A website for gamers will need a very different look and feel than a website
1
CHAPTER 1
8059ch01.qxd 3/8/07 1:44 PM Page 1
selling home childproofing devices and safety seats. Site content goes hand in glove with the
purpose of your site and your target audience. Without content, you will not attract visitors
or keep them on your site long enough to fulfill your site goals. Unlike in the movie Field of
Dreams, just because you build it doesn’t mean “they will come.” Consider the quantity and
type of content you have or can develop when planning your website.
If this is a new website, a domain name and web hosting will need to be obtained (more
on this later in the chapter). If the website already exists, you should evaluate your existing site
to determine if it is achieving your site goals.
We will begin with the typical reasons for creating a website.
Typical Website Objectives
While there is frequently some overlap, websites are basically divided into two general
categories: personal or business.
Personal Sites
Personal sites are often made for one of the following uses:
• For fun: To share your personal thoughts with the world at large, consider a blog instead
of a traditional website. You can use Expression Web to personalize and make even a
standard blog application reflect who you are.
• For keeping in touch with family and friends: Examples are a site for planning family
reunions or for sharing photos and video clips.

• For sharing a hobby or interest with fellow enthusiasts: This may have elements of a
community site or be more like a personal blog site.
• As a neighborhood or group site: Creating this type of website is typically a volunteer
position when you are part of an organization such as a garden club, scouts, neighbor-
hood association, or other non-profit group.
Business Sites
Most sites on the Web have at least some business component. The most common types of
business sites follow:
• An e-commerce site: To sell a product online, usually through the aid of a database-
driven shopping cart. An e-commerce site can also be a static site with payment
buttons for PayPal, Google Checkout, or some other payment gateway.
• An information site: To provide product or company information, including frequently
asked questions, shipping terms, privacy policies, and other information that would be
of interest to customers, with perhaps a secondary goal of selling products. You can
save money on support costs when manuals, product specification, and other materials
are available to your customers online.
CHAPTER 1

BEFORE YOU BEGIN2
8059ch01.qxd 3/8/07 1:44 PM Page 2
• A brochure website: To follow up offline marketing such as television, radio, and tele-
phone advertising where either cost or space does not allow all the information to be in
the offline marketing.
• Find new customers: To expand your customer base into new markets. This can be espe-
cially important when your products are specialized ones that attract a small number of
enthusiasts.
It’s common to have more than one objective on a business site. A short list follows:
• Giving visitors a favorable impression of your company or organization
• Developing a qualified prospect list
• Selling products directly by taking credit card information over the Internet

• Encouraging potential customers to phone or mail you to consummate a sale
• Making product information and price lists available to distributors
• Making product information and price lists available to customers
• Strengthening brand identification
• Creating a community of users
Decide what your objectives need to be, and rank them in priority. Next, consider who
your target visitor will be.

Tip
Be realistic about who will visit your site and what they will do there.
Attracting the Site Visitors You Want
Before your site can achieve your goals, you must not only know what your site objectives are
but also what visitors you need to attract to your site to accomplish those goals. A site with the
objective of selling $900 latte machines will not succeed if it only attracts college students. No
matter how much coffee the students might drink, few can afford to spend $900 for their cof-
fee makers. Their parents are more likely to be in a position to afford the machines and would
likely make purchases for themselves, not their offspring.
Picture Your Target Visitor
Typically, you will have some idea of the people you want to visit your site even if it is, “I want
people to come, spend lots of money, and make me wealthy enough to retire in two years.” If
CHAPTER 1

BEFORE YOU BEGIN 3
8059ch01.qxd 3/8/07 1:44 PM Page 3
your target is too broad, you will need to narrow it. Look at the following examples to see how
you can narrow down the target for a site selling children’s clothes:
• Focus on the current customers, or, if the business is new, on those who are likely to
become customers. Then, combine the characteristics of those customers into two or
three different “people” to represent your target market.
• Be realistic about your target customers. For example, our children’s clothing site might

include the following target customers:
• Stay-at-home moms with too many children to take shopping simultaneously
• Working mothers with no time to shop
• Grandparents who want well-dressed grandchildren to show off in pictures
• Decide what elements the potential visitors have in common. See if your target market
is too broad or too narrow.
Content Equals Credibility
No matter how great your site looks or how well you know your target audience, a site without
content will not be successful. There must be well written content for your website to rank
well in search engines. Even if your visitors arrive at your site as a result of offline promotion,
direct links, and personal referrals, there must be content that will keep them on your site
once they have found it. The nature of your content as well as your site purpose and target
audience will determine the feature set you need to have on your site.

Tip
Remember the KIS principle: Keep It Simple.
When you know what content you will have, you can start to organize your site to perform
the functions that visitors expect and/or need to see. Structure your website to make it easy
for your visitors to find what they need. Putting your site structure on paper will help you see
your site’s organization. This site map does not need to be as complicated as the one shown in
Figure 1-1.
Instead, a site map can be something as simple as hand written notes on categories and
connections between them, as Figure 1-2 shows.
CHAPTER 1

BEFORE YOU BEGIN4
8059ch01.qxd 3/8/07 1:44 PM Page 4

×