HTML (HyperText Markup Language) is the foundational language used to structure and display content on the web. It provides the framework for web pages, enabling browsers to interpret and render text, images, links, and other elements in a structured format.
HTML documents are plain text files with the .html extension. They are composed of elements enclosed in tags, defining the content and structure of a webpage.
<!DOCTYPE html>
<html>
<head>
<title>A Web Page</title>
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This is a paragraph.</p>
<a href="https://example.com">Visit Example</a>
</body>
</html>
<!DOCTYPE html>: Declares the document as HTML5.<html>: Root element of the HTML document.<head>: Contains metadata like the title, links to stylesheets, and scripts.<body>: Contains the visible content of the webpage, such as text, images, and links.<> to define the type of content. Most tags come in pairs, e.g., <h1> and </h1>.<a href="https://example.com">.HTML elements can be nested to create complex layouts. For example:
<div>
<h1>Title</h1>
<p>Some content</p>
</div>
HTML enables linking to other pages (<a>), embedding images (<img>), and including videos and audio (<video> and <audio>).
HTML defines the content of a webpage. CSS defines the style and layout. JavaScript adds interactivity. Together, these technologies form the core of front-end web development.