I would like to mark a tag with an id in HTML like this:
<span id="id_errortag"
style="font-family:Helvetica;Font-size:14px;" class="red"></span>
I want to find out whether this is ok by HTML standards to use an id in conjunction with a class?
It is perfectly acceptable to use both an id and a class on an HTML element, so long as you remember that id’s must be unique on the page. Classes can be used to group elements, but id must be unique.
Aside from classes, you can use other attribute selectors to identify elements. You aren’t limited to just class and id. For instance, you could use a CSS selector to change the color of an input with a certain value.
Keep in mind that one of the uses of class/id selectors is to help you keep your content, presentation, and behavior separate from each other, which will make it easier for Web designers to work with you. With CSS selectors, your JavaScript can be kept completely in external JavaScript files, your CSS can all be kept in an external CSS file, and your content can be kept inside the HTML.
If someone needs to change the presentation or behavior, they can do so without needing to modify the HTML, and if someone needs to change the style, they don’t need to modify the HTML. This not only helps reduce bugs, but makes the code easier to maintain.