First developed by Tim Berners-Lee in 1990, HTML is short for HyperText Markup Language. HTML is used to create electronic documents (called pages) that are displayed on the World Wide Web. Each page contains a series of connections to other pages called hyperlinks. Every web page you see on the Internet is written using one version of HTML code or another.
HTML code ensures the proper formatting of text and images so that your Internet browser may display them as they are intended to look. Without HTML, a browser would not know how to display text as elements or load images or other elements. HTML also provides a basic structure of the page, upon which Cascading Style Sheets are overlaid to change its appearance. One could think of HTML as the bones (structure) of a web page, and CSS as its skin (appearance).
What does an HTML tag look like?
As seen above in the above example of an HTML tag there are not many components. Almost all HTML tags have an opening tag that contains the name with any attributes and a close tag that contains a forward slash and the name of the tag that is being closed. For tags that do not have a closing tag like the tag, it is best practice to end the tag with a forward slash.
Each tag is contained within a less than and greater than angle brackets and everything between the opening and closing tag is displayed or affected by the tag. In the above example the tag is creating a link called “Computer Hope” that is pointing to the hope.html file.
What does HTML look like?
The following is an example of a basic web page written in HTML as well as a description of each section and its function.
<!DOCType HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<h1>This is a heading</h1>
<p>This is an example of a basic HTML page.</p>
The box above contains the key ingredients to a basic web page. The first line (DOCType) describes what version of HTML the page was written in so that an Internet browser can interpret the text that follows. Next, the HTML opening tag lets the browser know that it is reading HTML code. The HTML tag is followed by the head section which contains information about the page such as its title, meta tags, and where to locate the CSS file. The body section is all content that is viewable on the browser. For example, all the text you see here is contained within the body tags. Finally, closing tags wrap each element for proper syntax.