Complete Information About Hypertext Markup Language | Programming
Summary
HTML, short for Hypertext Markup Language, is a tag-based language used for creating web pages. It consists of markup symbols, known as elements or tags, which instruct web browsers on how to display information. Each element has a start and end tag, and some are self-closing. HTML includes attributes that provide additional information to elements. Named character references are used to give special meanings to characters like <, >, &, and ". HTML also supports comments for programmers to understand and collaborate on code. Additionally, HTML documents require a Doctype declaration at the beginning, specifying the version of HTML used, such as in HTML5.
Table of Content
Without HTML language, browsers fail to understand the format of the information that needs to be displayed on the web page. Read this article and learn more about HTML.
What is HTML?
HTML stands for Hypertext Markup Language. The word markup is usually used by editors for making markings in manuscripts when they want to give them for revision. HTML language also includes a set of markup symbols that gives instructions to the web browser on how to display data or information on the web page. Each markup code is referred to as an element. These elements are often referred to as tags; in fact, HTML language is known as tag-based language.
HTML code ensures that the information on the web page is displayed as intended by the HTML programmer. The web browser interprets the commands given in the HTML and then displays information on the web page. Without HTML language, browsers fail to understand the format of the information that needs to be displayed on the web page. All the web pages consist of HTML code. To view the HTML code, you have to keep the mouse pointer on the center of the web page and press right-click; then, you will be given options in that you have to select view source code. On clicking, the web page's source code will be displayed on your screen.
Elements consist of two matching tags and everything in between. For example, to represent a paragraph, we use the element at the start and end of the paragraph we use. Similarly, we use an element for inserting an image, and the closing element will be. Some tags are self-closing and do not contain any content.
Attributes
When a start tag or element contains additional information, this information is referred as an attribute. Attributes is divided into two parts, (1) Attribute Name and (2) Attribute value. Some attributes have only one value and these attributes are referred as Boolean attributes. To specify a Boolean, the programmer can leave the attribute value as blank and specify the attribute name.
Named character references
Name character references are used for print characters that have special meaning in HTML. For instance HTML language interprets less-than and greater-than symbols as tag delimiters. So if you want to give these symbols a special meaning then you can use Name Character References. This is very useful when you want to give special meaning to the symbols.
Listed below are few examples of named character references:
> denotes the greater-than sign (>)
< denotes the less-than sign (<)
& denotes the ampersand (&)
" denotes double quote (")
Though, there are many other entities available in the HTML language, but the listed above are the most used ones. These are important because by default they hold a different meaning in HTML language and also these are the entities that are most commonly used by the programmers to give an explicit meaning.
Comments and Doctype
For embedding the comments HTML uses a special mechanism which, does not display the message that is written in the HTML code. These comments are useful for the programmers, to easily understand the code. These type of mechanism is useful when a group of programmers are working on the same project. With the help of these comments, other programmers or the people who are new to the project will get a complete understanding of the code. These comments are useful for future references, and if there are any changes or updates in particular block, then it can be easily identified with the help of these comments.
Below is the example of HTML comments:
HTML document must contain Doctype declaration. The declaration must be made in the very first line of the HTML document. You can observe these declarations in the top most section of the code. Another thing that you must remember is that Doctype is not a tag. Doctype tells the browser about the version of HTML the page is written in.
In the latest version of HTML which is HTML5, the declaration is written as shown below:
Conclusion
The HTML languages consist of many more attributes and entities. If you are interested to know more about HTML language, it is advisable you refer to books to gain in-depth knowledge about the subject or attend training sessions.