HyperText Markup Language

From Canonica AI

Introduction

HyperText Markup Language, commonly referred to as HTML, is the standard markup language used in creating web pages and web applications. With CSS, and JavaScript, it forms a triad of cornerstone technologies for the World Wide Web.

History

HTML was first created by Tim Berners-Lee, Robert Cailliau, and others starting in 1989. It stands as one of the core languages of the World Wide Web and is used to structure content and documents on the internet. HTML is also used to create user interfaces for many mobile applications, and to create and structure content in many desktop applications.

A close-up of HTML code on a computer screen.
A close-up of HTML code on a computer screen.

Syntax and structure

HTML is a markup language, which means it is used to "mark up" the content within a document, in this case a web page, with structural and semantic information that tells a browser how to display a page. HTML uses "tags" to mark up content. Tags are simply words or abbreviations enclosed in angle brackets, like

for paragraph,

for first-level heading, and so on.

HTML Elements

An HTML element is an individual component of an HTML document. It represents some kind of structure or semantics and is delineated by tags. For example, the

element represents a paragraph of text, while the <a> element represents a hyperlink. Elements can also have attributes, which are extra bits of information that can be included within the opening tag. For example, the <a> element often includes the href attribute, which specifies the URL of the page the link goes to.

HTML Document Structure

At a high level, an HTML document is structured like this:

<!DOCTYPE html> <html>

 <head>
 </head>
 <body>
 </body>

</html>

The <!DOCTYPE html> declaration is used to inform the web browser about the version of HTML the page is written in. It is not an HTML tag; it is an instruction to the web browser.

The <html> element is the root element of an HTML page. The <head> element contains meta-information about the HTML page, such as its title, scripts, and link to CSS files. The <body> element contains the main content, such as text, images, headings, links, tables, lists, etc.

HTML Versions

Since its inception, HTML has undergone many changes. The latest version, HTML5, introduces many new syntactic features, which include the <video>, <audio>, and <canvas> elements, as well as the integration of SVG content. These features are designed to make it easy to include and handle multimedia and graphical content on the web without having to resort to proprietary plugins and APIs.

HTML and CSS

HTML is often used in conjunction with CSS to style and layout web pages. CSS can be included in HTML documents in three ways: inline, internal, and external. Inline styles are placed directly into the HTML tags using the style attribute. Internal styles are placed in the head of the HTML document. External styles are placed in a separate file and linked to the HTML document using the link tag.

HTML and JavaScript

HTML is also used in conjunction with JavaScript to add interactivity to web pages. JavaScript can be included in HTML documents in two ways: inline and external. Inline scripts are placed directly into the HTML document using the script tag. External scripts are placed in a separate file and linked to the HTML document using the script tag with the src attribute.

Conclusion

HTML is a fundamental technology used to define the structure of web content. Understanding HTML is key to understanding how web content is structured and displayed. With the advent of HTML5, HTML has become even more important in the field of web development, as it now allows for more interactive and dynamic web pages.

See Also