Understanding HTML Tags
Swipe to show menu
HTML (HyperText Markup Language) is the language used to structure content on the web. An HTML file (.html) tells the browser how to display text, images, lists, tables, and more.
What Are Tags?
Tags are the basic building blocks of HTML. They define elements such as paragraphs, buttons, sections, and images. Tags are written inside angle brackets: <tagname>.
Most tags come in pairs:
- Opening tag:
<tagname>; - Closing tag:
</tagname>.
Content goes between them.
index.html
This HTML code consists of three elements:
<section>: represents a section element, which is typically used to group related content together;<p>: represents a paragraph element, which is used to define a block of text;<button>: represents a button element, which can be clicked to perform an action.
No worries, all these elements and more will be explored in detail in future chapters. This is just a simple example to get you started.
Comments
Comments let you add notes inside your HTML code. The browser ignores them, so they don't appear on the page.
index.html
1. How would you correctly wrap the "My first paragraph" text in an HTML <p> tag?
2. What syntax is used to leave a comment?
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat