HTML (Hypertext Markup Language) is the standard markup language for creating web pages. It provides the structure and content of a webpage, defining the elements and their relationships.
To start using HTML, you need a text editor and a web browser. Here are the steps to create a basic HTML document:
- Open a text editor (e.g., Notepad, Visual Studio Code).
- Create a new file with the
.html
extension (e.g.,index.html
). - Add the HTML doctype declaration at the beginning of the file:
<!DOCTYPE html>
. - Create the HTML document structure using the
<html>
,<head>
, and<body>
tags. - Add content to the document using various HTML elements such as headings, paragraphs, links, images, etc.
- Save the file and open it in a web browser to see the rendered webpage.
HTML elements are the building blocks of a webpage. Here are some commonly used elements:
<h1>
to<h6>
: Headings of different levels.<p>
: Paragraph.<a>
: Anchor (link) element.<img>
: Image element.<ul>
and<ol>
: Unordered and ordered lists.<li>
: List item.<div>
: Division or container element.<span>
: Inline container element.<table>
: Table element.<form>
: Form element.<video>
: Video element.<input>
: Input element.audio
: Audio player element.canvas
: Canvas element.
For more information on HTML elements, refer to this link.
HTML elements can have attributes that provide additional information or functionality. Here are some commonly used attributes:
class
: Specifies one or more class names for an element.id
: Specifies a unique identifier for an element.src
: Specifies the source URL of an image or media file.href
: Specifies the URL of a linked resource.style
: Specifies inline CSS styles for an element.alt
: Specifies alternative text for an image.
HTML is a fundamental technology for web development. It allows you to create structured and interactive web pages. By understanding the basic HTML elements and attributes, you can start building your own web projects.
For more detailed information and examples, refer to the official HTML documentation and online tutorials.