HTML and CSS

HTML

Hypertext Markup Language (HTML) is the primary language of the web. All web pages are written in HTML. HTML was developed in 1991 by Tim Berners-Lee. When it was designed, HTML was envisioned as a document format for researchers to exchange documents. Today, HTML has been repurposed to build all sorts of content on the Internet, including dynamic web applications.

A HTML document is a raw text document that contains tags like <p></p>. Tags tells the browser how to display the element, and what kind of element it is.

Some common tags:

There are also other tags that allow you to embed other resources:

Most browsers ship with a tool that allows you to analyze the structure of a HTML document. In Chrome and Firefox, you can access the tool by right-clicking on the page and clicking Inspect Element. This displays a pane containing the parsed HTML source. You can then hover your mouse over elements in the source to see the corresponding rendered elements in the page.

There are a number of different versions of HTML, which differ in the elements that are allowed, and in their structure. This web page uses HTML 5. The standard document structure of a HTML 5 document is shown below.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
    <title>Hello world!</title>
</head>
<body>
	<h1>Hi</h1>
	<p>Hello world!</p>
</body>
</html>

The title of the page goes in the <title> element. The displayed content of the page goes within the <body> section. Most of the elements discussed above go within the <body> section, with the exception of the <style> and <link> elements, which should go in the <head> section.