Difference between revisions of "HTML"
(→Information) |
|||
Line 1: | Line 1: | ||
− | = HTML | + | = HTML = |
− | '''HTML''' | + | '''HTML''' (HyperText Markup Language) is the standard markup language used for creating web pages and web applications. It is the backbone of virtually every website you visit, providing the structure and content of web pages. |
− | == HTML is a | + | == Purpose == |
+ | HTML's primary purpose is to define the structure of content on the web. It uses a system of "elements" (tags) to categorize and organize different parts of a web page, such as headings, paragraphs, images, links, lists, and tables. Browsers interpret this markup to display the content as intended. | ||
− | + | == How it Works == | |
+ | HTML documents are plain text files saved with .html or .htm extensions. A web browser reads these files and renders the content according to the HTML tags. For example, a <p> tag tells the browser to display text as a paragraph, while an <img> tag tells it to embed an image. | ||
− | + | HTML works in conjunction with other technologies: | |
− | |||
− | + | '''CSS (Cascading Style Sheets):''' Used to control the appearance and layout of web pages (colors, fonts, spacing). | |
− | + | '''JavaScript:''' Used to add interactivity and dynamic behavior to web pages. | |
− | HTML | + | == Basic Structure == |
+ | A typical HTML document includes: | ||
− | + | <!DOCTYPE html>: Declares the document type and HTML version. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <html>: The root element of an HTML page. | |
+ | |||
+ | <head>: Contains metadata about the HTML document (e.g., character set, page title, links to CSS files, scripts). This content is not displayed on the web page itself. | ||
+ | |||
+ | <body>: Contains all the visible content of the web page (headings, paragraphs, images, links, etc.). | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <!DOCTYPE html> | ||
+ | <html> | ||
+ | <head> | ||
+ | <title>My First Web Page</title> | ||
+ | </head> | ||
+ | <body> | ||
+ | Your text/code | ||
+ | <img src="image.jpg" alt="A descriptive image"> | ||
+ | </body> | ||
+ | </html> | ||
+ | |||
+ | == Key Concepts == | ||
+ | |||
+ | Tags and Elements: HTML uses tags to define elements. Elements consist of an opening tag, content, and a closing tag. Some elements are self-closing. | ||
+ | |||
+ | Attributes: Provide additional information about an element (e.g., src for image source, href for link destination). | ||
+ | |||
+ | Hyperlinks: The "HyperText" in HTML refers to its ability to link documents together using the <a> (anchor) tag. | ||
+ | |||
+ | Semantic HTML: Using HTML elements that convey meaning about the content helps with accessibility and search engine optimization. | ||
== See Also == | == See Also == | ||
− | + | *[[CSS]] | |
− | + | *[[JavaScript]] | |
− | * [[CSS]] | + | |
− | * [[JavaScript]] | ||
− | |||
− | |||
− | [[Category: | + | [[Category:Information]] |
− | |||
− |
Latest revision as of 10:04, 10 June 2025
HTML
HTML (HyperText Markup Language) is the standard markup language used for creating web pages and web applications. It is the backbone of virtually every website you visit, providing the structure and content of web pages.
Purpose
HTML's primary purpose is to define the structure of content on the web. It uses a system of "elements" (tags) to categorize and organize different parts of a web page, such as headings, paragraphs, images, links, lists, and tables. Browsers interpret this markup to display the content as intended.
How it Works
HTML documents are plain text files saved with .html or .htm extensions. A web browser reads these files and renders the content according to the HTML tags. For example, a
tag tells the browser to display text as a paragraph, while an <img> tag tells it to embed an image. HTML works in conjunction with other technologies: CSS (Cascading Style Sheets): Used to control the appearance and layout of web pages (colors, fonts, spacing). JavaScript: Used to add interactivity and dynamic behavior to web pages.
Basic Structure
A typical HTML document includes:
<!DOCTYPE html>: Declares the document type and HTML version.
<html>: The root element of an HTML page.
<head>: Contains metadata about the HTML document (e.g., character set, page title, links to CSS files, scripts). This content is not displayed on the web page itself.
<body>: Contains all the visible content of the web page (headings, paragraphs, images, links, etc.).
Example:
<!DOCTYPE html> <html> <head> <title>My First Web Page</title> </head> <body> Your text/code <img src="image.jpg" alt="A descriptive image"> </body> </html>
Key Concepts
Tags and Elements: HTML uses tags to define elements. Elements consist of an opening tag, content, and a closing tag. Some elements are self-closing.
Attributes: Provide additional information about an element (e.g., src for image source, href for link destination).
Hyperlinks: The "HyperText" in HTML refers to its ability to link documents together using the <a> (anchor) tag.
Semantic HTML: Using HTML elements that convey meaning about the content helps with accessibility and search engine optimization.