⭐ CHAPTER: Creating Frames and Forms in HTML5
(Page 63 to Page 71 – Full Easy Notes + Codes)
✅ PAGE 63 — HTML Frames
⭐ What is an HTML Frame?
Earlier HTML allowed dividing one browser window into multiple sections.
Each section could load a different webpage.
This was done using the <iframe> tag.
Frame = “Inline Frame” → A small window inside the main webpage.
⭐ Syntax of iframe
⭐ Important Attributes
| Attribute | Purpose | Example |
|---|---|---|
| src | Sets the file/webpage that will appear inside the frame | <iframe src="demo.html"> |
| height | Sets frame height in pixels | <iframe height="200"> |
| width | Sets frame width in pixels | <iframe width="400"> |
⭐ Activity: Creating an inline frame (Page 63)
This will show another file inside the current HTML file.
HTML Code:
✅ PAGE 64 — Changing the Border of iframe
⭐ By default iframe has a border.
We can change:
✔ size
✔ color
✔ style
Using CSS style attribute.
⭐ Activity: Change size, color and style of border
HTML Code:
⭐ Removing the Border
Use:
HTML Code:
✅ PAGE 65 — iframe as a Target of a Link
We can open a webpage inside iframe by clicking a link.
For this we use the target attribute inside <a> tag.
Example:
The iframe must have a name:
⭐ Activity: Creating an iframe target for a link
HTML Code:
✅ PAGE 66 — The <form> Element
⭐ What is a Form?
Form collects information from user:
✔ name
✔ email
✔ password
✔ gender
✔ feedback
etc.
It is only a container, not visible itself.
⭐ Syntax
⭐ Important Form Tags
| Tag | Use |
|---|---|
<input> | text box, password, button etc. |
<label> | label for input |
<select> | drop-down |
<textarea> | multi-line box |
<button> | button |
<fieldset> | group items |
<legend> | title of fieldset |
<datalist> | suggestions list |
✅ PAGE 67 — The <input> Element
⭐ What is input tag?
Used to create many types of input fields.
⭐ Syntax
⭐ Types of Input
| Type | Description |
|---|---|
| text | single-line text |
| password | masked text |
| radio | select one |
| checkbox | select many |
| button | clickable |
| submit | submit form |
| reset | clear form |
| color | choose a color |
⭐ Creating a Text Field (Activity)
HTML Code:
⭐ Creating a Password Field
HTML Code:
✅ PAGE 68 — The <label> Element
⭐ Use of label
Label gives name to input field.
Also increases accessibility.
⭐ Syntax
for="id of input"
⭐ Example Code
⭐ Creating Radio Buttons
HTML Code:
✅ PAGE 69 — Creating Checkboxes
HTML Code:
⭐ Creating Submit & Reset Buttons
HTML Code:
✅ PAGE 70 — The <textarea> Element
⭐ Multi-line text input field
Syntax:
Example:
⭐ The <select> and <option> Elements
Used to create drop-down list.
Syntax:
Example:
✅ PAGE 71 — <fieldset> and <legend> Elements
Used to group related information in a form.
Example Code:
⭐ Sample Registration Form (Full Code)