HTML
HTML
citgn
Introduction to HTML:
HTML, or Hypertext Markup Language, is the backbone of web development. It provides the
structure for web pages. Each HTML file consists of elements enclosed in tags. Tags are keywords
surrounded by angle brackets. Let's start with a simple example:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
Here, <!DOCTYPE html> declares the document type, <html> is the root element, <head> contains
meta-information, and <body> contains the visible content. The heading <h1> and paragraph <p> are
basic HTML elements.
HTML elements are building blocks of a webpage. Each element has a start tag, content, and an end
tag. Some elements, like line breaks (<br>), don't have an end tag. Tags can also have attributes.
Consider the following examples:
<p>This is a <strong>bold</strong> text.</p>
In the first example, the <strong> tag makes text bold. The second example creates a hyperlink using
the <a> (anchor) tag.
HTML Forms:
Forms facilitate user input. Essential form elements include input fields, buttons, and dropdowns.
Here's a simple form:
<label for="username">Username:</label>
</form>
This form sends data to "/submit form" when submitted. It has a text input field and a submit button.
HTML allows organizing content with lists and tables. Lists can be ordered (<ol>) or unordered (<ul>),
and tables consist of rows (<tr>) and cells (<td>). Examples:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
HTML Multimedia:
</video>
These tags provide a seamless way to incorporate multimedia into your web content.