How to Edit an HTML File

Image Credit: tumsasedgars/iStock/GettyImages

HyperText Markup Language or HTML is the basic programming language of the World Wide Web. It's used to specify the basic layout and functionality of a website. You can edit an HTML file using any plain text editor or a specialized tool that outputs HTML based on your input.

HTML, CSS and JavaScript

Modern web browsers understand three programming languages. HTML is used to code the basic layout of a web page and introduce functional elements such as forms, images and sections of text. It can also be used for some style specifications.

Another language called cascading style sheets or CSS is used to further style how a page looks on a screen or when printed to paper. CSS can be embedded in HTML or referred to by HTML code and stored in separate files.

A third language, known as JavaScript, is used to add additional functionality such as interactivity and computation to websites. It can also either be embedded in HTML files or stored in separate files. As the name suggests, it is similar to another programming language called Java, although the two aren't cross-compatible and shouldn't be confused with one another.

Edit an HTML File

HTML, CSS and JavaScript all have their own syntax rules that must be followed to generate valid code that a web browser can understand, but they're stored in plain text files.

They can be edited with any plain text editing software, including Notepad on Windows, TextEdit on macOS computers, and popular text editors such as Emacs, Vim and Sublime Text. Typically, HTML files are saved with a .html extension. Avoid using word processing tools such as Microsoft Word and Google Docs to edit HTML because they're not as well suited to dealing with plain text as they are to constructing elaborate documents with custom fonts and formatting.

Some developers prefer to use integrated development environments or configure their text editors to include advanced features such as highlighting different parts of HTML code or suggesting where elements should be placed. Modern web browsers also make it possible to tweak HTML and JavaScript and edit code while debugging through various built-in developer tools.

Generated HTML

Various tools make it possible to generate HTML without writing it directly. Some web design tools like Adobe's Dreamweaver and online tools such as Wix and Squarespace automatically output HTML based on what users enter through a visual interface.

Others, like some software for web forums and wikis, automatically take other, simpler formatting languages such as Markdown and translate them into HTML and CSS. Web server software, such as Django and Rails, can also automatically generate HTML based on configuration settings and data.

references