HTML Tags Code Format and Syntax
“HTML” stands for hypertext mark-up language and is the prevalent coding option for web pages on the internet. The language was invented in 1989 by Tim Berners-Lee and Robert Cailliau (see this Wikipedia reference), and has been widely used since in subsequent versions. HTML tags are the primary component used to translate information into the visual format of most websites.
The basic structure for HTML includes elements, attributes and content. Elements are the primary building blocks of a web page and include items such as text, images and links. Each element has a beginning and ending pair of tags that must be used to render it correctly. Tags utilize the less-than (<) and greater-than (>) keys found on your keyboard. An ending tag is differentiated from a beginning tag by using the forward slash key (/) prior to the element name.
HTML elements can contain any number of attributes that are coded within the beginning HTML tag. Attributes may include typeface, color, size, horizontal and vertical alignment, width, height, background and many other configurations for how the element is displayed.
The content within an HTML document appears between the beginning and ending element tag. It represents the information to which the element attributes will be applied. For example text that you want to appear on your web page will be surrounded by a “FONT” tag that may designate the typeface and size of the text as it appears on the page, as well as whether it will be bold, italic or in a specific color.
Line breaks and word spaces executed by your keyboard’s return key and space bar are not reflected in the HTML syntax. Both a single space and a double space return have a specific HTML tag. Although single spaces between words shows up in HTML coded pages, multiple spaces do not. A blank space (like what your space bar provides) can be executed in your content area with an HTML special character code. When programmers write an HTML document, many include line breaks to make it easier to read and troubleshoot the code because the breaks do not show up in the final programmed web page.
The basic structure for HTML tag codes follows the format in this generic example:
<element attribute=”attribute choice”> CONTENT GOES HERE
Because formatting features of many word processing software packages interfere with the correct HTML tags code display, it is best to write your HTML code in a plain text editor like Notepad or BBEdit. Many web development software programs execute HTML code for you, while displaying a WYSIWYG interface. However, you have the advantage of being able to simplify tasks or fine-tune your code details if you know the HTML tags and understand the proper syntax of the language.
The additional parts of this article series provide an alphabetical HTML tags list that includes the programming code for each tag and a description of how it is used. For the purpose of displaying the articles, the less-than and greater-than symbols have been replaced by an asterisk (*) in the code examples provided. If you’re looking for a particular HTML tag’s code, just click to the corresponding alphabetical article to see how to properly write the code.
This post is part of the series: HTML Tag Glossary
The series offers an on-going glossary of alphabetized HTML tags. Beginning with an overview of HTML and its correct syntax, it serves as a resource for learning how to code various HTML functions in your web pages.