Difference between revisions of "M1 Introduction to HTML"
(→HTML?) |
(→Tags) |
||
| Line 34: | Line 34: | ||
=== Tags === | === Tags === | ||
| + | |||
| + | Tags in HTML are special words or symbols enclosed in angle brackets (< >) that define the structure and formatting of elements within a web page. They act as instructions to the web browser on how to display and interpret the content. Opening tags, such as <tagname>, mark the beginning of an element, while closing tags, like </tagname>, denote the end. Tags are like containers that hold different types of content, such as text, images, links, or other elements, and they play a crucial role in creating the structure and appearance of a webpage. | ||
| + | |||
| + | Here are some of the most common HTML tags you will encounter. Get to know these well. For more information on how to use a given tag, [[https://developer.mozilla.org/en-US/docs/Web/HTML/Element|the MDN docs]] are an incredible resource. | ||
| + | |||
| + | {| class="wikitable" | ||
| + | |- | ||
| + | ! style="width:15%" | Tag | ||
| + | ! style="width:85%" | Description | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><html></source> | ||
| + | | Defines the root element of an HTML document. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><head></source> | ||
| + | | Contains metadata and information about the HTML document. (docs) | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><title></source> | ||
| + | | Sets the title of the document, displayed in the browser's title bar or tab. (docs) | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><body></source> | ||
| + | | Represents the main content of the HTML document. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><h1></source> to <source lang="html" enclosed="false"><h6></source> | ||
| + | | Defines headings of different levels, from the most important (<source lang="html" enclosed="false"><h1></source>) to the least (<source lang="html" enclosed="false"><h6></source>). | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><p></source> | ||
| + | | Represents a paragraph of text. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><a></source> | ||
| + | | Creates a hyperlink to another web page, file, or a specific location within the same page. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><img></source> | ||
| + | | Inserts an image into the HTML document. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><ul></source> | ||
| + | | Represents an unordered list (a bulleted list). | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><ol></source> | ||
| + | | Represents an ordered list (a numbered list). | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><li></source> | ||
| + | | Defines an item in a list (<source lang="html" enclosed="false"><ul></source> or <source lang="html" enclosed="false"><ol></source>). | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><table></source> | ||
| + | | Represents tabular data organized into rows and columns. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><tr></source> | ||
| + | | Defines a row within a table. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><td></source> | ||
| + | | Defines a cell within a table row (<source lang="html" enclosed="false"><tr></source>). | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><th></source> | ||
| + | | Defines a header cell within a table row (<source lang="html" enclosed="false"><tr></source>). | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><div></source> | ||
| + | | Defines a division or a container for other elements. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><span></source> | ||
| + | | Defines an inline container for a small section of HTML. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><form></source> | ||
| + | | Creates an interactive form for user input. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><input></source> | ||
| + | | Creates an input field for user data entry. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><button></source> | ||
| + | | Creates a clickable button. | ||
| + | |- | ||
| + | | <source lang="html" enclosed="false"><textarea></source> | ||
| + | | Creates a multiline text input field. | ||
| + | |} | ||
Revision as of 04:21, 27 June 2023
HTML
HTML?
HTML, which stands for HyperText Markup Language, is the standard language used to create webpages. It describes the structure and content of a webpage. HTML uses a system of tags and attributes to define elements on the page. These elements can be things like headings, paragraphs, links, images, lists, tables, forms, and many more. Each of these elements has a specific tag that describes what it is and helps the browser know how to display it.
Here's a very basic example:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Website!</h1>
<p>This is a paragraph of text.</p>
</body>
</html>
Image will go here
In this example:
<!DOCTYPE html>is the document type declaration. This tells the browser that this document is an HTML document.- The
<html>tag is the root of an HTML document. - The
<head>tag contains meta-information about the document. This can include the title, character set declarations, CSS style definitions, and more. - The
<title>tag is the title of the document and is displayed in the browser's title bar or tab. - The
<body>tag contains the content of the document, such as text, hyperlinks, images, tables, lists, etc. When you visit a website, the content you see is rendered in the body. - The
<h1>tag defines a top-level heading, and the<p>tag defines a paragraph.
In essence, HTML gives the webpage its basic structure and content; without it, a webpage can't exist.
Tags
Tags in HTML are special words or symbols enclosed in angle brackets (< >) that define the structure and formatting of elements within a web page. They act as instructions to the web browser on how to display and interpret the content. Opening tags, such as <tagname>, mark the beginning of an element, while closing tags, like </tagname>, denote the end. Tags are like containers that hold different types of content, such as text, images, links, or other elements, and they play a crucial role in creating the structure and appearance of a webpage.
Here are some of the most common HTML tags you will encounter. Get to know these well. For more information on how to use a given tag, [MDN docs] are an incredible resource.
| Tag | Description |
|---|---|
<html>
|
Defines the root element of an HTML document. |
<head>
|
Contains metadata and information about the HTML document. (docs) |
<title>
|
Sets the title of the document, displayed in the browser's title bar or tab. (docs) |
<body>
|
Represents the main content of the HTML document. |
<h1>
<h6>
|
Defines headings of different levels, from the most important (<h1>
<h6>
|
<p>
|
Represents a paragraph of text. |
<a>
|
Creates a hyperlink to another web page, file, or a specific location within the same page. |
<img>
|
Inserts an image into the HTML document. |
<ul>
|
Represents an unordered list (a bulleted list). |
<ol>
|
Represents an ordered list (a numbered list). |
<li>
|
Defines an item in a list (<ul>
<ol>
|
<table>
|
Represents tabular data organized into rows and columns. |
<tr>
|
Defines a row within a table. |
<td>
|
Defines a cell within a table row (<tr>
|
<th>
|
Defines a header cell within a table row (<tr>
|
<div>
|
Defines a division or a container for other elements. |
<span>
|
Defines an inline container for a small section of HTML. |
<form>
|
Creates an interactive form for user input. |
<input>
|
Creates an input field for user data entry. |
<button>
|
Creates a clickable button. |
<textarea>
|
Creates a multiline text input field. |