Datasheet

Writing CSS
To write CSS, just as is the case when writing HTML source, you will need a text editor. WYSIWYG
(What You See Is What You Get) editors such as Microsoft Word aren’t ideally suited for CSS because the
environment is not ideal for the composition of source code. WYSIWYG programs often have features
like AutoCorrection and line wrapping; a plain text editor is more appealing precisely because it does
not have these automatic features. Furthermore, the more automated WYSIWYG editors are designed to
write the source code for you behind the scenes, so you don’t have complete control over the structure
and formatting of the source code. In contrast, a plain text editor doesn’t insert anything into the source
code beyond what you type into the text editor.
The Windows Notepad program is one example of a text editor that is ideal for composing source code.
To launch Notepad, choose Start Run and then type Notepad in the Open text box. You can also use
Microsoft FrontPage, but FrontPage is best used in view source mode where you can edit the source code
directly instead of via the WYSIWYG interface. The same holds true for Macromedia Dreamweaver.
On Mac OS X, the Notepad equivalent is TextEdit, which can be found in the Mac OS X Applications
folder.
If Notepad or TextEdit is just too basic for your taste, a text editor that highlights markup and CSS syn-
tax might suit your needs better. The following are full-featured alternative text editors for Windows:
Crimson Editor:
www.crimsoneditor.com (free)
HTML-kit:
www.chami.com/html-kit (free)
Here are some alternative text editors that work with Mac OS X:
CreaText:
http://creatext.sourceforge.net (free)
BBEdit:
www.barebones.com (shareware)
If you’re using Linux, you’re probably already familiar with the different text editors that come bundled
with the various distributions.
You must create HTML files with the
.html extension. If you use Notepad or TextEdit, beware of your
files being saved with a
.txt extension, which will not result in the HTML file you were going for.
To ensure that your files are saved properly on Windows, choose Start Run and type Explorer (or
right-click Start and choose Explore from the pop-up menu) to open Windows Explorer. After Windows
Explorer is open, choose Tools Folder Options to open the Folder Options window, click the View tab,
and uncheck the Hide Extensions for Known File Types box (see Figure 1-3). Then click OK.
HTML files are not the only file type in which the document extension is important; other file types
require specific extensions as well. Those file types are covered later in this chapter.
14
Part I: The Basics
05_096970 ch01.qxp 4/20/07 11:27 PM Page 14