- •Taking Your Talent to the Web
- •Introduction
- •1 Splash Screen
- •Meet the Medium
- •Expanding Horizons
- •Working the Net…Without a Net
- •Smash Your Altars
- •Breath Mint? Or Candy Mint?
- •Where’s the Map?
- •Mars and Venus
- •Web Physics: Action and Interaction
- •Different Purposes, Different Methodologies
- •Web Agnosticism
- •Point #1: The Web Is Platform-Agnostic
- •Point #2: The Web Is Device-Independent
- •The 18-Month Pregnancy
- •Chocolatey Web Goodness
- •’Tis a Gift to Be Simple
- •Democracy, What a Concept
- •Instant Karma
- •The Whole World in Your Hands
- •Just Do It: The Web as Human Activity
- •The Viewer Rules
- •Multimedia: All Talking! All Dancing!
- •The Server Knows
- •It’s the Bandwidth, Stupid
- •Web Pages Have No Secrets
- •The Web Is for Everyone!
- •Swap text and code for images
- •Prune redundancy
- •Cache as Cache Can
- •Much Ado About 5K
- •Screening Room
- •Liquid Design
- •Color My Web
- •Thousands Weep
- •Gamma Gamma Hey!
- •Typography
- •The 97% Solution
- •Points of Distinction
- •Year 2000—Browsers to the Rescue
- •Touch Factor
- •Appropriate Graphic Design
- •User Knowledge
- •What Color Is Your Concept?
- •Business as (Cruel and) Usual
- •The Rise of the Interface Department
- •Form and Function
- •Copycats and Pseudo-Scientists
- •Chaos and Clarity
- •A Design Koan: Interfaces Are a Means too Often Mistaken for an End
- •Universal Body Copy and Other Fictions
- •Interface as Architecture
- •Ten (Okay, Three) Points of Light
- •Be Easily Learned
- •Remain Consistent
- •Continually Provide Feedback
- •GUI, GUI, Chewy, Chewy
- •It’s the Browser, Stupid
- •Clarity Begins at Home (Page)
- •I Think Icon, I Think Icon
- •Structural Labels: Folding the Director’s Chair
- •The Soul of Brevity
- •Hypertext or Hapless Text
- •Scrolling and Clicking Along
- •Stock Options (Providing Alternatives)
- •The So-Called Rule of Five
- •Highlights and Breadcrumbs
- •Consistent Placement
- •Brand That Sucker!
- •Why We Mentioned These Things
- •The year web standards broke, 1
- •The year web standards broke, 2
- •The year web standards broke, 3
- •The year the bubble burst
- •5 The Obligatory Glossary
- •Web Lingo
- •Extranet
- •HTML
- •Hypertext, hyperlinks, and links
- •Internet
- •Intranet
- •JavaScript, ECMAScript, CSS, XML, XHTML, DOM
- •Web page
- •Website
- •Additional terminology
- •Web developer/programmer
- •Project manager
- •Systems administrator (sysadmin) and network administrator (netadmin)
- •Web technician
- •Your Role in the Web
- •Look and feel
- •Business-to-business
- •Business-to-consumer
- •Solve Communication Problems
- •Brand identity
- •Restrictions of the Medium
- •Technology
- •Works with team members
- •Visually and emotionally engaging
- •Easy to navigate
- •Compatible with visitors’ needs
- •Accessible to a wide variety of web browsers and other devices
- •Can You Handle It?
- •What Is the Life Cycle?
- •Why Have a Method?
- •We Never Forget a Phase
- •Analysis (or “Talking to the Client”)
- •The early phase
- •Design
- •Brainstorm and problem solve
- •Translate needs into solutions
- •Sell ideas to the client
- •Identify color comps
- •Create color comps/proof of concept
- •Present color comps and proof of concept
- •Receive design approval
- •Development
- •Create all color comps
- •Communicate functionality
- •Work with templates
- •Design for easy maintenance
- •Testing
- •Deployment
- •The updating game
- •Create and provide documentation and style guides
- •Provide client training
- •Learn about your client’s methods
- •Work the Process
- •Code Wars
- •Table Talk
- •XHTML Marks the Spot
- •Minding Your <p>’s and q’s
- •Looking Ahead
- •Getting Started
- •View Source
- •A Netscape Bonus
- •The Mother of All View Source Tricks
- •Doin’ it in Netscape
- •Doin’ it in Internet Explorer
- •Absolutely Speaking, It’s All Relative
- •What Is Good Markup?
- •What Is Sensible Markup?
- •HTML as a Design Tool
- •The Frames of Hazard
- •Please Frame Safely
- •Framing Your Art
- •<META> <META> Hiney Ho!
- •Search Me
- •Take a (Re)Load Off
- •WYSIWYG, My Aunt Moira’s Left Foot
- •Code of Dishonor
- •WYS Is Not Necessarily WYG
- •Publish That Sucker!
- •HTMHell
- •9 Visual Tools
- •Photoshop Basics: An Overview
- •Comp Preparation
- •Dealing with Color Palettes
- •Exporting to Web-Friendly Formats
- •Gamma Compensation
- •Preparing Typography
- •Slicing and Dicing
- •Rollovers (Image Swapping)
- •GIF Animation
- •Create Seamless Background Patterns (Tiles)
- •Color My Web: Romancing the Cube
- •Dither Me This
- •Death of the Web-Safe Color Palette?
- •A Hex on Both Your Houses
- •Was Blind, but Now I See
- •From Theory to Practice
- •Format This: GIFs, JPEGs, and Such
- •Loves logos, typography, and long walks in the woods
- •GIFs in Photoshop
- •JPEG, the Other White Meat
- •Optimizing GIFs and JPEGs
- •Expanding on Compression
- •Make your JPEGS smaller
- •Combining sharp and blurry
- •Animated GIFs
- •Creating Animations in ImageReady
- •Typography
- •The ABCs of Web Type
- •Anti-Aliasing
- •Specifying Anti-Aliasing for Type
- •General tips
- •General Hints on Type
- •The Sans of Time
- •Space Patrol
- •Lest We Fail to Repeat Ourselves
- •Accessibility, Thy Name Is Text
- •Slicing and Dicing
- •Thinking Semantically
- •Tag Soup and Crackers
- •CSS to the Rescue…Sort of
- •Separation of Style from Content
- •CSS Advantages: Short Term
- •CSS Advantages: Long Term
- •Compatibility Problems: An Overview
- •Working with Style Sheets
- •Types of Style Sheets
- •External style sheets
- •Embedding a style sheet
- •Adding styles inline
- •Fear of Style Sheets: CSS and Layout
- •Fear of Style Sheets: CSS and Typography
- •Promise and performance
- •Font Size Challenges
- •Points of contention
- •Point of no return: browsers of the year 2000
- •Absolute size keywords
- •Relative keywords
- •Length units
- •Percentage units
- •Looking Forward
- •11 The Joy of JavaScript
- •What Is This Thing Called JavaScript?
- •The Web Before JavaScript
- •JavaScript, Yesterday and Today
- •Sounds Great, but I’m an Artist. Do I Really Have to Learn This Stuff?
- •Educating Rita About JavaScript
- •Don’t Panic!
- •JavaScript Basics for Web Designers
- •The Dreaded Text Rollover
- •The Event Handler Horizon
- •Status Quo
- •A Cautionary Note
- •Kids, Try This at Home
- •The Not-So-Fine Print
- •The Ever-Popular Image Rollover
- •A Rollover Script from Project Cool
- •Windows on the World
- •Get Your <HEAD> Together
- •Avoiding the Heartbreak of Linkitis
- •Browser Compensation
- •JavaScript to the Rescue!
- •Location, location, location
- •Watching the Detection
- •Going Global with JavaScript
- •Learning More
- •12 Beyond Text/Pictures
- •You Can Never Be Too Rich Media
- •Server-Side Stuff
- •Where were you in ‘82?
- •Indiana Jones and the template of doom
- •Serving the project
- •Doing More
- •Mini-Case Study: Waferbaby.com
- •Any Size Kid Can Play
- •Take a Walk on the Server Side
- •Are You Being Served?
- •Advantages of SSI
- •Disadvantages of SSI
- •Cookin’ with Java
- •Ghost in the Virtual Machine
- •Java Woes
- •Java Woes: The Politically Correct Version
- •Java Joys
- •Rich Media: Exploding the “Page”
- •Virtual Reality Modeling Language (VRML)
- •SVG and SMIL
- •SMIL (through your fear and sorrow)
- •Romancing the logo
- •Sounds dandy, but will it work?
- •Promises, Promises
- •Turn on, Tune in, Plug-in
- •A Hideous Breach of Reality
- •The ubiquity of plug-ins
- •The Impossible Lightness of Plug-ins
- •Plug-ins Most Likely to Succeed
- •Making It Work: Providing Options
- •The “Automagic Redirect”
- •The iron-plated sound console from Hell
- •The Trouble with Plug-ins
- •If Plug-ins Run Free
- •Parting Sermon
- •13 Never Can Say Goodbye
- •Separation Anxiety
- •A List Apart
- •Astounding Websites
- •The Babble List
- •Dreamless
- •Evolt
- •Redcricket
- •Webdesign-l
- •When All Else Fails
- •Design, Programming, Content
- •The Big Kahunas
- •Beauty and Inspiration
- •Index
266 HOW: Style Sheets for Designers: Working with Style Sheets
Leading on the Web serves exactly the same purpose as leading in print: it adds air to the “page” and enhances readability. On the screen-based Web, with its low typographic resolution, anything we can do to encourage readability is all right by us. By contrast, reading may be discouraged when we fail to apply leading and other CSS niceties to our text (see Figure 10.3).
Figure 10.3
The Adobe web column, written by your humble author, but laid out by Adobe’s online design team. CSS is used to control typography, but the small text is tough on the eyes. CSS leading and a larger font-size would make the reading experience more pleasurable. This typographic approach works well for image captions, a staple of the Adobe site, but it is less well-suited to longish articles (www.adobe.com).
Now that we’ve taken a brief look at the rudiments of CSS, let’s see how web designers can make this work on a site.
Types of Style Sheets
There are three main ways to use style sheets on a website:
1.By linking to an external style sheet from the HTML document
2.By embedding a style sheet within each HTML document
3.By adding styles inline in an HTML document
Taking Your Talent to the Web |
267 |
Additionally, it is possible to import one style sheet into another. Unfortunately, this technique is not supported by Netscape Navigator 4, so we will confine our discussion to the first three items. If Netscape 4 has gone to its reward by the time you buy this book, you can read up on “CSS import” at www.w3.org/Style/CSS/.
External style sheets
Linking to an external style sheet enables you control multiple web pages (or even an entire site) using a single CSS document. The more pages controlled by the same CSS document, the easier it becomes to make design changes to that site. It is literally possible to change the appearance of a 5,000-page website in under a minute, simply by editing one external Style sheet. Trust us, this is one maintenance chore you will genuinely enjoy.
Five steps to paradise: creating an external style sheet
1.Essentially, in BBEdit, PageSpinner, HomeSite, or any other HTML editor, the designer creates a style sheet. For simplicity’s sake, here is a basic one:
BODY {background: white; font-family: helvetica, arial, sans-serif;}
H1 {font-weight: bold; font-size: 24px; }
P, LI {font-size: 12px; line-height: 150%;}
2.The designer saves this document with a filename ending in .css. For instance, the name could be style.css, or clientname.css.
3.This CSS file is then uploaded to the server via FTP, just like an HTML
file.
4.Next, in the website’s HTML files, the designer inserts one additional line of code within the <HEAD> tag:
<html>
<head>
<title>Welcome to Widgets.com</title>
<link rel=”stylesheet” HREF=”style.css” TYPE=”text/css”> </head>
<body>
…and so on.
268 HOW: Style Sheets for Designers: Working with Style Sheets
5.The <link> tag calls up the separate syle sheet file (style.css) and uses its contents as instructions for displaying the page.
Note that it is possible to link to a CSS file using a relative path (“../styles/ style.css”), a rooted URL (“/path/from/server/root/style.css”), or a full URL (http://www.widgets.com/styles/style.css). This style sheet will now control any web page that links to it via the additional line of code within the <HEAD> tag. An entire site can be controlled in this way.
Embedding a style sheet
Web designers who wish to affect only one page may do so by embedding a style sheet within the <HEAD> tag of that web page.
<html>
<head>
<title>Style Sheets Rule!</title> <style type=”text/css”>
<!--
BODY {background: #ffc; font-family: palatino, georgia, times new roman, serif;} P {font-size: small; line-height: 125%;}
.sub {font: large bold arial, helvetica, sans-serif; margin-top: .25in;} -->
</head>
Note the use of commenting to prevent older, non-CSS-capable browsers from being confused by the code and to prevent search engines from pointlessly indexing your style sheet:
<!--
(Anything within comments will be ignored by browsers that do not understand the code, and ignored as well by search engines. Have a nice day.)
-->
What else is new in this example? The CSS is preceded by a tag that tells the browser how to interpret it:
<style type=”text/css”>
A more complete heading tells the browser not only that what follows is an embedded CSS, but also tells what type of media the CSS is intended to support:
<link REL=”StyleSheet” HREF=”style.css” TYPE=”text/css” MEDIA=”screen”>
Taking Your Talent to the Web |
269 |
The idea is that a document can link to several style sheets. For instance, one controls screen presentation (MEDIA=”screen”), another printing, and a third audio browsers. Not all browsers support this as of now, though it’s a good idea to begin fully spec’ing your CSS anyway.
In a Class by Itself
All of the preceding is straightforward, but what does .sub mean in this line?
.sub {font: large bold arial, helvetica, sans-serif; margin-top: .25in;}
The selector labeled .sub is a unique class, created by the web designer for his or her own particular design needs on this page.
That’s correct. CSS not only gives web designers the power to style traditional HTML markup, it also enables them to create and style unique items to suit their needs.
For instance, here, the web designer wished to create a special subhead class with a quarter-inch margin at the top. She decided to call it sub because the name was easy to remember and indicated the purpose (subhead) for which the class was created. The designer could have called this class unclecharlie if she wished.
To make use of this special class, the web designer will refer to it in the HTML document in this way:
<div class=”sub”>Here is my subhead, with a quarter-inch margin at the top.</div>
In the web page, the line, Here is my subhead, with a quarter-inch margin at the top would be large, bold, Arial or Helvetica (or generic sans serif) with (surprise!) a quarter-inch margin at the top.
Style sheets rock.
Adding styles inline
The inline method is used when the web designer wishes to change the appearance of a single tag or group of tags on one page, and not for changing the entire page or site. Adding styles inline does not offer web designers the true power of CSS because it forces them to restyle text one item at a time. Still, it can be very useful at times.
270 HOW: Style Sheets for Designers: Working with Style Sheets
For instance, an entire page or site may be set in medium-size Verdana (Helvetica, Arial, sans serif). But one line of text needs to stand out from the rest. Perhaps this line of text represents a letter from a customer—or a message from the U.S. Internal Revenue Service. The web designer decides that this particular line of text should be set in 12px Monaco.
She could create an entire class just for that line of text and include that class in the site’s global style sheet, but why create an entire class for one line of text on a single web page? Inline styling does the job better:
<p style=”font: 12px monaco, monospace;”> Greetings from the I.R.S.</p>
Inline styling seems like an oddity, but it is actually a wonderful supplemental tool—much like a tube of touch-up paint that is used to correct a small detail.
Inline styling is also quite effective for improving the appearance of <FORM> elements:
<div align=”center”> <form>
<input
type=”button” style=”font-size: 12px; font-family: geneva, arial; background-color: #ff6600; color: #ffffff;”
value=”Previous Reports” onClick=”window.location=’com0400d.html’;” onMouseOver=”window.status=’More of same.’; return true;” onMouseOut=”window.status=’’;return true;”>
</form>
</div>
Form elements also may be styled via DIV classes in a global style sheet. If every <FORM> button on your site is supposed to be orange (#ff6600) and use 12px Geneva or Arial type, by all means create an orangebutton class for the site, declare it on the global style sheet, and then refer to it in individual HTML pages, like so:
<div align=”center”> <form>
<input type=”button” class=”orangebutton”