HTML (HyperText Markup Language) is the standard language used to create and design documents on the World Wide Web. Here are some key concepts and
elements of HTML theory:
Basic Concepts
1. **Markup Language**: HTML is a markup language, which means it uses tags to annotate text. These annotations tell the browser how to display the
content.
2. **Elements and Tags**: HTML consists of elements represented by tags. Tags are enclosed in angle brackets (`< >`). Most elements have an opening tag
and a closing tag, with content in between.
- Example: `<p>This is a paragraph.</p>`
3. **Attributes**: Tags can have attributes, which provide additional information about the element. Attributes are included in the opening tag.
- Example: `<a href="https://example.com">Link</a>`
Structure of an HTML Document
An HTML document typically includes the following basic structure:
```html
<!DOCTYPE html>
<html lang="en">
, <head>
<meta charset="UTF-8">
<title>Document Title</title>
</head>
<body>
<h1>Heading</h1>
<p>Paragraph of text.</p>
</body>
</html>
```
- `<!DOCTYPE html>`: Declares the document type and version of HTML.
- `<html>`: The root element that contains the entire HTML document.
- `<head>`: Contains meta-information about the document (e.g., title, character set).
- `<body>`: Contains the content of the document, such as text, images, links, etc.
Common HTML Elements
1. **Headings**: Represented by `<h1>` to `<h6>`, where `<h1>` is the highest level heading, and `<h6>` is the lowest.
- Example: `<h1>Main Heading</h1>`
elements of HTML theory:
Basic Concepts
1. **Markup Language**: HTML is a markup language, which means it uses tags to annotate text. These annotations tell the browser how to display the
content.
2. **Elements and Tags**: HTML consists of elements represented by tags. Tags are enclosed in angle brackets (`< >`). Most elements have an opening tag
and a closing tag, with content in between.
- Example: `<p>This is a paragraph.</p>`
3. **Attributes**: Tags can have attributes, which provide additional information about the element. Attributes are included in the opening tag.
- Example: `<a href="https://example.com">Link</a>`
Structure of an HTML Document
An HTML document typically includes the following basic structure:
```html
<!DOCTYPE html>
<html lang="en">
, <head>
<meta charset="UTF-8">
<title>Document Title</title>
</head>
<body>
<h1>Heading</h1>
<p>Paragraph of text.</p>
</body>
</html>
```
- `<!DOCTYPE html>`: Declares the document type and version of HTML.
- `<html>`: The root element that contains the entire HTML document.
- `<head>`: Contains meta-information about the document (e.g., title, character set).
- `<body>`: Contains the content of the document, such as text, images, links, etc.
Common HTML Elements
1. **Headings**: Represented by `<h1>` to `<h6>`, where `<h1>` is the highest level heading, and `<h6>` is the lowest.
- Example: `<h1>Main Heading</h1>`