💾 Archived View for gem.sdf.org › s.kaplan › cheatsheets › programming-languages › html.md captured on 2024-03-21 at 15:45:59.

View Raw

More Information

⬅️ Previous capture (2023-09-28)

-=-=-=-=-=-=-

# HTML Cheatsheet

## Unique Features

- Hypertext markup language used to create web pages
- Uses tags to define the structure and content of a web page
- Can include links, images, videos, audio, and other media types
- Supports forms for user input and interaction

## Basic Structure

<!DOCTYPE html>

<html>

<head>

<title>Page Title</title>

</head>

<body>

<h1>Heading 1</h1>

<p>Paragraph</p>

</body>

</html>


## Tags

- `<html>`: Defines an HTML document
- `<head>`: Contains metadata for the document
- `<title>`: Defines a title for the document
- `<body>`: Contains the visible page content
- `<h1>` to `<h6>`: Defines headings of different sizes
- `<p>`: Defines a paragraph
- `<a>`: Defines a hyperlink
- `<img>`: Defines an image
- `<ul>`: Defines an unordered list
- `<ol>`: Defines an ordered list
- `<li>`: Defines a list item
- `<form>`: Defines a form for user input
- `<input>`: Defines an input field
- `<button>`: Defines a clickable button
- `<label>`: Defines a label for an input element
- `<select>`: Defines a drop-down list
- `<option>`: Defines an option in a drop-down list

## Attributes

- `id`: Defines a unique identifier for an element
- `class`: Defines one or more classes for an element
- `style`: Defines inline CSS styles for an element
- `src`: Defines the URL of an image or other media element
- `href`: Defines the URL of a hyperlink
- `alt`: Defines alternative text for an image
- `type`: Defines the type of an input element
- `name`: Defines a name for an input element
- `value`: Defines a value for an input element

## Resources

- [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML)
- [W3Schools](https://www.w3schools.com/html/)