1. Introduction to HTML
HTML stands for Hypertext Markup Language, which is the standard language used for creating web pages and applications. It provides the structure and layout for displaying content on the internet.
2. Basic HTML Structure
Every HTML document starts with a declaration, indicating that it is an HTML5 document. The tag holds the entire content of the webpage, and the
tag contains meta information and the title of the webpage. The tag holds the visible content.3. Formatting Text
HTML allows you to format text using various tags. For example, the
to
tags represent different heading levels, with
being the highest. The
being the highest. The
tag is used to create paragraphs, and the and tags are used for bold and italic text respectively.
4. Adding Images
You can include images in your web page using the tag. The ‘src’ attribute specifies the path to the image file, and the ‘alt’ attribute provides alternative text that is displayed if the image fails to load. The width and height can also be defined using respective attributes.
5. Creating Links
Links are a fundamental part of the web. You can create links using the tag. The ‘href’ attribute specifies the URL of the destination page. Additionally, the ‘target’ attribute can be used to specify how the linked page opens (e.g. in a new tab).
6. Working with Lists
HTML supports both ordered and unordered lists. To create an ordered list, use the
- tag, and for unordered lists, use the
- tag. Nested lists can also be created by placing a list inside another list item.
7. Tables
Tables are used to display tabular data in rows and columns. The
tag represents the table, and the
tag represents each row of the table. The tag is used to define each cell in a row. Additional tags like and can be used for header cells and table captions respectively. 8. Forms and Input
HTML provides various form elements for gathering user input. The
- tag. Each list item is represented by the