How to edit and test your web pages
How to edit a web page with Notepad++
If you're using Windows, we recommend that you use Notepad++ as your editor because it provides all of these features. In addition to Notepad++, though, there are many other free and commercial text editors. For instance, Adobe Dreamweaver and Microsoft Expression Web Designer are two popular commercial editors. For the purposes of this book, however, Notepad++ provides all of the features that you'll need.
If you're a Mac OS user, we recommend that you use TextWrangler as your editor. This is a free editor that provides syntax highlighting and FTP access, although it doesn't provide auto-completion. Here again, though, you have other choices like commercial editors that do provide auto-completion. Three that do are BBEdit (the commercial version of TextWrangler), TextMate, and Dreamweaver.
Before you start using Notepad++, you should take the time to turn on the auto-completion feature. You will also want to change the style for comments because the default style is too small. These skills are summarized in this figure.
Then, when you start a new file, you should let Notepad++ know what language you're working with. To do that, you can either save the file with the .html, .css, or .js extension, or you can use the Language menu to select the language. Once you do that, this editor uses the appropriate color coding and auto-completion lists.
One feature not shown in this figure is how to access the files on an FTP server with Notepad++. To find out how to do that, you can search the Internet for "Notepad++ FTP".
Notepad++ with six tabs open and an auto-completion list displayed
How to open, save, close, and start files
- To open a file, use the FileOpen command. Or, right-click on the file in the Windows Explorer and select the Edit with Notepad++ command. The file is opened in a new tab.
- To save or close a file, select the tab that it's in and use the FileSave or FileClose command. Or right-click on the tab, and select the appropriate command.
- To start a new file in a new tab, use the FileNew command.
How to change the style for comments
How to use the auto-completion feature
- To enable auto completion, use the SettingsPreferences command, click the Backup/Auto-completion tab, and check the "Enable Auto-completion on each input" box.
- The auto-completion feature displays a list of terms that start with what you've typed. To insert one of those terms, double-click on it or use the arrows keys to highlight it and press the Tab key. To show the auto-completion list at any time, press Ctrl+Space.
How to let Notepad++ know which language you're working with
Figure 2-1 How to edit a web page with Notepad++