Docsity

Introduction to HTML & Basic Tags - Complete Beginner Notes, Study notes of Computer science

Partial preview of the text

Download Introduction to HTML & Basic Tags - Complete Beginner Notes and more Study notes Computer science in PDF only on Docsity!

Introduction to HTML

& Basic Tags

Beginner-Friendly HTML Book

A simple guide to understanding HTML, basic tags, elements, attributes, links, images, lists, tables, and

forms.

Table of Contents

1. Introduction to HTML

2. What is HTML?

3. History of HTML

4. Why Do We Use HTML?

5. How HTML Works

6. Basic Structure of an HTML Document

7. HTML Elements and Tags

8. HTML Attributes

9. Headings

10. Paragraphs

11. Line Breaks

12. Horizontal Lines

13. Text Formatting Tags

14. Links

15. Images

16. Lists

17. Comments

18. HTML Tables โ€” Introduction

19. HTML Forms โ€” Introduction

20. Common Mistakes Beginners Make

21. Complete Basic HTML Example

22. Practice Exercises

23. Summary

24. Important Questions

Chapter 1: Introduction to HTML

What is HTML?

HTML stands for HyperText Markup Language. It is the standard markup language used to create and

structure content on web pages. HTML can create headings, paragraphs, images, links, lists, tables,

forms, and buttons.

Example

Welcome to My Website

This is my first webpage.

Important Parts

<!DOCTYPE html> tells the browser the document uses modern HTML.

<html> is the root element.

<head> contains document information.

<title> defines the browser-tab title.

<body> contains visible webpage content.

Chapter 7: HTML Elements and Tags

HTML uses tags to define different types of content. An HTML element commonly has an opening tag,

content, and a closing tag.

Example

Hello World

Empty Elements

Some elements do not need a separate closing tag. Examples include and .

Chapter 8: HTML Attributes

Attributes provide additional information about HTML elements. They are written inside the opening tag.

Example

Visit Website

Common Attributes

href specifies a link destination. src specifies a resource such as an image. alt provides alternative text for

an image.

Chapter 9: HTML Headings

HTML provides six heading levels, from h1 to h6.

Example

Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6

Chapter 10: Paragraphs

The

element is used to create paragraphs.

Example

HTML provides structure to a webpage.

CSS can be used to style the webpage.

Chapter 11: Line Breaks

The element creates a line break.

Example

HelloWelcome to my website.

Chapter 12: Horizontal Lines

The element creates a horizontal separator between sections.

Example

About Me

This section contains information about me.

Chapter 13: Text Formatting Tags

HTML provides elements for emphasis and text semantics.

Examples

Important text Emphasized text Italic-style text Underlined text Highlighted text Small text Deleted text Inserted text H2O x2

Chapter 14: HTML Links

Links are created using the element. The href attribute specifies the destination.

Example

Visit Website About Us

Chapter 15: Images

The element displays images. The src attribute specifies the image location and alt provides

alternative text.

Example

Forms allow users to enter and submit information.

Example

Name:

Email:

Submit

Forms are commonly used for login pages, registration, contact forms, search boxes, and online

applications.

Chapter 20: Common Mistakes Beginners Make

1. Forgetting closing tags

Incorrect:

Hello. Better:

Hello

2. Incorrect nesting

Incorrect:

Hello

. Correct:

Hello

3. Missing quotation marks

Incorrect: Website. Better: Website

4. Missing alt text

Use:

Chapter 21: Complete Basic HTML Example

The following example combines many basic concepts.

Example

My First Webpage

Welcome to My Website

Hello! This is my first HTML webpage.

My Hobbies

Reading Writing Learning Web Development

My Favorite Website Visit Website My Image

Chapter 22: Practice Exercises

Exercise 1

Create a webpage containing your name as an h1, a paragraph about yourself, three hobbies in an

unordered list, and one link.

Exercise 2

Create headings for My Education, Matriculation, FA, and Web Development.

Exercise 3

Create a student table containing Name, Age, and Class using table, tr, th, and td.

Exercise 4

Create a contact form containing Name, Email, Message, and a Submit button.

Chapter 23: Summary

HTML is the foundation of webpage structure. It uses elements and tags to describe different pieces of

content. HTML is a markup language, not a programming language.

Key concepts: HTML documents use .html files; h1โ€“h6 create headings; p creates paragraphs; a creates

links; img displays images; ul and ol create lists; attributes provide extra information; comments use HTML

comment syntax; tables organize data; forms collect user input.

Chapter 24: Important Questions

Short Questions

1. What is HTML?

2. What does HTML stand for?

3. What is the purpose of the element?

4. What is an HTML attribute?

5. What is the difference between and ?

6. What is the purpose of the alt attribute?

Long Questions

1. Explain the basic structure of an HTML document with an example.

2. Explain HTML tags and elements with examples.

3. Explain headings, paragraphs, links, images, and lists in HTML.

4. Explain HTML attributes and give examples.