Building Blocks
Building Blocks of HTML
- HTML is the foundation language used to create webpages on the internet
- It is used to display and organize content such as text, images, links, and forms
- HTML works using a system of tags, which tell the browser how content should appear
- Learning HTML is important for anyone who wants to become a web developer, because it is the base of all websites
- HTML is built using small parts called building blocks
- These building blocks help in structuring and designing a webpage properly
- Each building block has a specific role in creating web content
The most important components of an HTML document are:
- Tags
- Attributes
- Elements
HTML Tags
- HTML tags are the foundation of HTML, making it possible to create web pages
- They are used to define how content should be structured and displayed in a browser
- Each tag provides instructions to the browser about content layout and meaning
Syntax
<tagname>Content goes here</tagname>
Examples
| Tag Β | Meaning |
|---|---|
| <h1> to <h6> Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β | Headings from most to least important |
| <p> | Paragraph |
| <a> | Anchor (hyperlink) |
| <div> | Division or section |
| <img> | Image |
| <br> | Line break |
HTML Attributes
- HTML attributes give extra information about HTML elements
- They help describe how an element should look or work
- Attributes are always written in the start tag
- Most attributes use a name = value format
- Example: name="value"
- They help change or control how elements appear in the browser
- Many HTML tags can use attributes to add more features or settings
Syntax
<tagname attribute="value">Content</tagname>
Β
Example
<p style="color:blue;">This paragraph is styled blue.</p>
<img src="photo.jpg" alt="A scenic view" width="400" height="300" />
<a href="https://www.tpointtech.com">Visit TPointTech</a>
HTML Elements
HTML elements are the basic parts used to build a webpage. They tell the browser how content should be organized and shown.
An HTML element is made using:
- a start tag
- some content
- an end tag
Together, they form a complete element.
Browsers use these elements to display different types of content like headings, paragraphs, images, links, and lists.