HTML (HyperText Markup Language) is the foundational language for creating and structuring web pages and web applications. It defines the content and structure of web documents through a system of tags and attributes. Here’s an overview of the key aspects of HTML:
An HTML document has a standard structure that includes the following essential elements:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document Title</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a paragraph.</p>
</body>
</html>
<!DOCTYPE html>
: Declaration defining the document type and HTML version.<html>
: Root element of the HTML document.<head>
: Contains meta-information about the document, such as title, character set, and links to stylesheets or scripts.<title>
: Specifies the title of the document, shown in the browser tab.<body>
: Contains the content of the web page, such as headings, paragraphs, images, and links.<h1>
to <h6>
tags define headings, with <h1>
being the highest level.<p>
tag defines paragraphs.<b>
, <i>
, <strong>
, and <em>
for bold, italic, strong emphasis, and emphasized text respectively.<a href="URL">
creates hyperlinks to other pages or resources.<img src="URL" alt="description">
embeds images with a source and alt text for accessibility.<ul>
with <li>
items for bullet points.<ol>
with <li>
items for numbered lists.<form>
encloses form elements and specifies the action (URL to send data to) and method (GET or POST).<input type="text">
, <input type="password">
, <input type="submit">
, etc., for different types of user inputs.<textarea>
for multi-line text input.<select>
with <option>
elements for drop-down menus.<table>
defines a table.<tr>
for rows, <td>
for data cells, and <th>
for header cells.<header>
, <nav>
, <main>
, <section>
, <article>
, <aside>
, and <footer>
provide meaning and structure to the document, improving accessibility and SEO.Attributes provide additional information about HTML elements and are included in the opening tag. Common attributes include:
id
: Unique identifier for the element.class
: Defines one or more class names for the element, which can be used for styling with CSS.style
: Inline CSS styles specific to that element.src
: Specifies the source URL for images and scripts.href
: Specifies the URL for links.alt
: Provides alternative text for images.HTML5 introduced several new elements and attributes, enhancing web functionality and accessibility:
<header>
, <footer>
, <nav>
, <article>
, <section>
, and <aside>
.<audio>
and <video>
for embedding media.email
, tel
, date
, and range
, and attributes like placeholder
and required
.<canvas>
for drawing graphics via JavaScript.localStorage
and sessionStorage
for storing data on the client side.alt
for images and use semantic elements to support screen readers.HTML is constantly evolving, but the core principles remain focused on providing a structured, readable, and accessible way to present content on the web.
JavaScript is a versatile, high-level programming language primarily used to create interactive and dynamic features…
CSS (Cascading Style Sheets) is a stylesheet language used to describe the presentation and design…
Front-end development focuses on creating the visual and interactive aspects of a website or web…
Modern physics is a broad field encompassing several sub-disciplines, including quantum mechanics, relativity, particle physics,…
This website uses cookies.