Coloring

Coloring of your HTML code is highly customizable. You can choose the colors you want for HTML tags, attributes, strings, JavaScript keywords, CSS keywords, and JavaScript and CSS comments.

The coloring in HTML mode is a little bit more complex than Alpha is designed for. Alpha was originally designed to color programming code. HTML documents contains both code and ordinary text and Alpha can't tell which words are code and which are ordinary text, when it colors your documents. Therefore the coloring will not always be perfect.

In the submenu 'Config -> Redefine Colors' there are seven extra colors 'color_9' ... 'color_15'. You can use these colors to define your own favorite colors for your HTML documents. By default these seven colors are undefined, but as soon as you give them a value they appear in the preferences dialog, where you can choose the colors you wants for the keywords.

By default the coloring of HTML tags is this:

For the coloring of the attributes to work the attribute values must be put inside quotes. If an attribute is written WIDTH=246 Alpha thinks WIDTH=246 is one single word and therefore doesn't find the word WIDTH= which it is supposed to color. To reduce this problem there is a function 'Quote all attributes' in the submenu 'Editing' of the HTML Utilities menu. This functions goes through your document and put quotes around all attributes.

There is also a simpler alternative for coloring, which you choose by checking 'Simple coloring' in the preferences dialog. When simple coloring is on the tags are colored all blue:

This can be a letter choice on lowend machines with slow graphics.

JavaScript and CSS

You can also choose if you want to color JavaScript and/or CSS keywords, and you can choose which colors you want for them. By default these keywords are not colored. Use the JavaScript and CSS preferences dialog to switch on the coloring. There you can also choose which colors you want for the keywords.

Coloring of JavaScript and CSS keywords is not possible if simple coloring in on.

Bug: The CSS keyword 'background-attachment' can't be colored because Alpha doesn't support keywords longer then 20 characters.