> For the complete documentation index, see [llms.txt](https://university-west.gitbook.io/programming-paradigms/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://university-west.gitbook.io/programming-paradigms/web-development/markup-languages/html.md).

# HTML

HTML, or HyperText Markup Language, is the standard markup language used to create and design web pages. It provides the structure of a webpage, allowing web browsers to interpret and display the content properly. HTML uses tags to define elements, such as paragraphs, headings, links, images, and other content, enabling the creation of visually engaging and functional websites.

HTML documents are plain text files that end with a .html or .htm extension. They can be created using a simple text editor or more sophisticated web development tools. Notably, HTML works in conjunction with CSS (Cascading Style Sheets) and JavaScript to create dynamic and stylish web pages.

Here is an example of a simple, W3C compliant HTML web page displaying "Hello World":

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello World</title>
</head>
<body>
    <h1>Hello World</h1>
</body>
</html>
```

#### HTML Tag Syntax

HTML tags are the building blocks of an HTML document. Each tag provides specific information about how the content should be structured or displayed in a web browser. Understanding the syntax of HTML tags is crucial for creating functional and aesthetically pleasing web pages.

**Opening and Closing Tags**

HTML tags typically come in pairs, comprising an opening tag and a closing tag.

* **Opening Tag:** Marks the beginning of an element. It consists of the tag name enclosed within angle brackets (`< >`). For example, `<p>` is the opening tag for a paragraph.
* **Closing Tag:** Marks the end of an element. It is similar to the opening tag but includes a forward slash (`/`) before the tag name. For example, `</p>` is the closing tag for a paragraph.

Example:

```html
<p>This is a paragraph.</p>
```

**Self-Closing Tags**

Some HTML tags do not have closing tags and are referred to as self-closing or void tags. These tags often embed or import other types of content into the document, such as images or input fields.

Example:

```html
<img src="image.jpg" alt="An example image">
<br>
```

**Nested Tags**

HTML elements can be nested within each other. This means you can place one element inside another to create complex web page structures. It's important to ensure that the tags are properly nested and closed in the correct order.

Example:

```html
<div>
  <p>This paragraph is inside a div element.</p>
</div>
```

**Attributes**

HTML tags can have attributes that provide additional information about an element. Attributes are placed within the opening tag, and they consist of an attribute name and a value, with the value enclosed in double quotes.

Common attributes include:

* `id`: Specifies a unique id for an element.
* `class`: Specifies one or more class names for an element.
* `src`: Specifies the source of an image.
* `alt`: Provides alternative text for an image.

Example:

```html
<img src="logo.png" alt="Company Logo" id="logo" class="responsive">
```

Understanding these fundamental aspects of HTML tag syntax will help you effectively structure and style your web pages.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://university-west.gitbook.io/programming-paradigms/web-development/markup-languages/html.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
