HTML which stands for "hyper-text mark-up Language" is a markup language used in programming.
Mark-up language is like a way to add "notes" 📝 to text or content, telling software (like browsers) how to display it.
A basic HTML has two parts, opening and closing tags. e.g <p></p>
HTML is having a definite structure which must be followed to build a webpage.
The structure
<!DOCTYPE html>
<html>
<head>
<title>
(...content...)
</title>
</head>
(... content..)
</body>
</html>
Any mistake made will affect your program causing it not to execute.
Coding in HTML has some key features;
- Tags
- Attribute
- Element
*Tags*
A tag is like a label that tells the browser what an element is.
Example: `<p>This is a paragraph</p>`
Here, `<p>` is the opening tag and `</p>` is the closing tag.
Tags usually come in pairs (opening + closing), but some are self-closing like `<img src="image.jpg">`.
*Attribute*
An attribute in HTML is like extra info added to a tag. It gives more details about the element.
Example: `<img src="image.jpg" alt="A description">`
Here, `src` and `alt` are attributes.
They usually have a name and a value (name="value").
*An Element*
An element in HTML is a whole thing made of a tag + content + attributes (if any).
Example: `<p class="intro">Hello World</p>`
Here, the whole thing is an element:
- Tag: `p`
- Attribute: `class="intro"`
- Content: `Hello World`