Online Book Reader

Home Category

HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [26]

By Root 1511 0


Microsoft Word

Just don’t use it for Web development. Word is a word processor. Even though, theoretically, it can create Web pages, the HTML code it writes is absolutely horrific. As an example, I created a blank document, wrote “Hello World” in it, changed the font, and saved it as HTML. The resulting page was non-compliant code, was not quite HTML or XHTML, and was 114 lines long. Word is getting better, but it’s just not a good Web development tool. In fact, don’t use any word processor. They’re just not designed for this kind of work.


Windows Notepad

Notepad is everywhere, and it’s free. That’s the good news. However, Notepad doesn’t have a lot of the features you might need, such as line numbers, multiple documents, or macros. Use it if you’re on an unfamiliar machine, but try something else if you can. Many people begin with Notepad, but it won’t be long until you outgrow its limitations.


Mac TextEdit

Mac has a simple text editor built in — TextEdit — that’s similar to Notepad, but closer to a word processor than a programmer’s text editor. TextEdit saves files in a number of formats. If you want to use it to write Web pages, you must save your files in plain-text format, and you must not use any of TextEdit’s formatting features. It’s probably best not to use TextEdit unless you really have to.


A noteworthy editor: Notepad++

A number of developers have come up with good text editors. Some of the best are free, such as Notepad++ by Don Ho. Notepad++ is designed for text editing, especially in programming languages. Figure 3-1 shows Notepad++ with an HTML file loaded.

Figure 3-1: Notepad++ has many of the features you need in a text editor.

Notepad++ has a lot of interesting features. Here are a few highlights:

♦ Syntax highlighting: Notepad++ can recognize key HTML terms and put different types of terms in different colors. For example, all HTML tags are rendered blue, and text is black, making it easy to tell if you’ve made certain kinds of mistakes, such as forgetting to end a tag. Note that the colors aren’t saved in the document. The coloring features are there to help you understand the code.

♦ Multiple files: You’ll often want to edit more than one document at a time. You can have several different documents in memory at the same time.

♦ Multi-language support: Currently, your pages consist of nothing but XHTML. Soon enough, you’ll use some other languages, like SQL, CSS, and PHP. Notepad++ is smart enough to recognize these languages, too.

♦ Macros: Whenever you find yourself doing something over and over, consider writing a keyboard macro. Notepad++ has a terrific macro feature. Macros are easy to record and play back a series of keystrokes, which can save you a lot of work.

♦ Page preview: When you write a page, test it. Notepad++ has shortcut keys built in to let you quickly view your page in Internet Explorer (Ctrl+Alt+Shift+I) and Firefox (Ctrl+Alt+Shift+X).

♦ TextFX: The open-source design of Notepad++ makes it easy to add features. The TextFX extension (built into Notepad++) allows you to do all sorts of interesting things. One especially handy set of tools runs HTML Tidy on your page and fixes any problems.

Sadly, Notepad++ is a Windows-only editor. If you’re using Mac or Linux, you need to find something else. Gedit is the closest alternative in the Linux world, but a few quality free editors exist for the Mac.


The old standards: VI and Emacs

No discussion of text editors is complete without a mention of the venerable UNIX editors that were the core of the early Internet experience. Most of the pioneering work on the Web was done in the UNIX and Linux operating systems, and these environments had two extremely popular text-editor families. Both might seem obscure and difficult to modern sensibilities, but they still have passionate adherents, even in the Windows community. (Besides, Linux is more popular than ever!)


VI and VIM

VI stands for VIsual Editor. That name seems strange now because most developers can’t imagine an editor that’s not visual.

Return Main Page Previous Page Next Page

®Online Book Reader