Writing HTML With Macintosh TextEdit

TextEdit and basic HTML is all you need to code a webpage

If you use a Mac, you don't need to buy or download an HTML editor to write HTML for a webpage. You have TextEdit, a perfectly functional text editor built into your macOS operating system. For many people, this is all they ever need to code a webpage—TextEdit and a basic understanding of HTML.

Prepare TextEdit to Work With HTML

TextEdit defaults to a rich text format, so you need to switch it to plain text to write HTML. Here's how: 

  1. Open the TextEdit application by clicking on it. Look for the application in the dock at the bottom of the Mac screen or in the Applications folder.

  2. Choose File > New on the menu bar.

  3. Click Format in the menu bar and choose Make Plain Text to switch to plain text.

Set Preferences for HTML Files 

The preference window in macOS's TextEdit app.

To set TextEdit preferences so it always opens HTML files in code-editing mode:

  1. With TextEdit open, click TextEdit in the menu bar and choose Preferences.

  2. Click the Open and Save tab.

  3. Click the box next to Display HTML files as HTML code instead of formatted text.

  4. If you plan to write HTML in TextEdit often, save the plain text preference by clicking on the New Document tab next to the Open and Save tab and select the radio button next to Plain text.

Write and Save the HTML File

  1. Write the HTML. You need to be more careful than with an HTML-specific editor because you won't have elements like tag completion and validation to prevent errors.

  2. Save the HTML to a file. TextEdit normally saves files with a .txt extension, but since you're writing HTML, you need to save the file as .html.

    • Go to the File menu.
    • Choose Save.
    • Enter a name for the file in the Save As field and add the .html file extension.
    • A pop-up screen asks if you want to append the standard extension .txt to the end. Choose Use .html.
  3. Drag the saved HTML file to a browser to check your work. If anything looks off, open the HTML file and edit the code in the affected section.

Basic HTML isn't terribly hard to learn, and you don't need to buy any additional software or other items in order to put up your webpage. With TextEdit, you can write complex or simple HTML. Once you learn HTML, you can edit pages as quickly as someone with an expensive HTML editor.

Format
mla apa chicago
Your Citation
Kyrnin, Jennifer. "Writing HTML With Macintosh TextEdit." ThoughtCo, Sep. 30, 2021, thoughtco.com/writing-html-with-textedit-3469897. Kyrnin, Jennifer. (2021, September 30). Writing HTML With Macintosh TextEdit. Retrieved from https://www.thoughtco.com/writing-html-with-textedit-3469897 Kyrnin, Jennifer. "Writing HTML With Macintosh TextEdit." ThoughtCo. https://www.thoughtco.com/writing-html-with-textedit-3469897 (accessed April 23, 2024).