2.00. - Elements of HTML
2.00. - Elements of HTML
Outline
• HTML Tags
• HTML Colors
Elements of HTML • Working with Text
• Working with List
Dr. Pankaj Kumar • Tables
• Frames
• Working with Hyperlinks
• Images and Multimedia
• Working with Forms and controls
1 2
3 4
5 6
1
25/10/2023
• The following three <div> elements have their background color set <p>Same as color name "Tomato":</p>
with RGB, HEX, and HSL values: <h1 style="background-color:rgb(255, 99, 71);">rgb(255, 99, 71)</h1>
<h1 style="background-color:#ff6347;">#ff6347</h1>
<h1 style="background-color:hsl(9, 100%, 64%);">hsl(9, 100%, 64%)</h1>
</body>
9 </html> 10
11 12
2
25/10/2023
15 16
17 18
3
25/10/2023
19 20
21 22
23 24
4
25/10/2023
27 28
5
25/10/2023
<tagname style="property:value;">
31 32
</body>
</html>
33 34
35 36
6
25/10/2023
</body>
</html>
37 38
39 40
</body>
</html>
41 42
7
25/10/2023
43 44
name. Then, define the CSS properties within curly braces {}. </style>
</head>
<body>
<h2>The id Attribute</h2>
<p>Use CSS to style an element with the
id "myHeader":</p>
<h1 id="myHeader">My Header</h1>
</body>
47 48
</html>
8
25/10/2023
49 50
51 52
53 54
9
25/10/2023
55 56
57 58
59 60
10
25/10/2023
11
25/10/2023
71 72
12
25/10/2023
13
25/10/2023
Table Header, Body, and Footer Table Header, Body, and Footer
<html>
• Tables can be divided into three portions − a header, a body, and a foot. <head>
<title>HTML Table</title>
The head and foot are rather similar to headers and footers in a word- </head>
<body>
processed document that remain the same for every page, while the body <table border = "1" width = "100%">
<thead>
is the main content holder of the table. <tr>
<td colspan = "4">This is the head of the
table</td>
• The three elements for separating the head, body, and foot of a table are </tr>
</thead>
<tfoot>
• <thead> − to create a separate table header. <tr>
<td colspan = "4">This is the foot of the
• <tbody> − to indicate the main body of the table. table</td>
</tr>
• <tfoot> − to create a separate table footer. </tfoot>
<tbody>
<tr>
• A table may contain several <tbody> elements to indicate different pages <td>Cell 1</td>
<td>Cell 2</td>
or groups of data. But it is notable that <thead> and <tfoot> tags should <td>Cell 3</td>
<td>Cell 4</td>
</tr>
appear before <tbody> </tbody>
</table>
</body>
</html>
79 80
almost all the tags inside table data tag <td>. </head>
<body>
<table border = "1" width = "100%">
<tr>
<td>
<table border = "1" width = "100%">
<tr>
<th>Name</th>
<th>Salary</th>
</tr>
<tr>
<td>Ramesh Raman</td>
<td>5000</td>
</tr>
<tr>
<td>Shabbir Hussein</td>
<td>7000</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
81 82
83 84
14
25/10/2023
87 88
89 90
15
25/10/2023
• Syntax
<iframe src="url" title="description"></iframe>
93 94
</body>
</html>
95 96
16
25/10/2023
99 100
101 102
17
25/10/2023
103 104
107 108
18
25/10/2023
109 110
111 112
113 114
19
25/10/2023
20
25/10/2023
123 124
21
25/10/2023
</body> </body>
</html> </html>
127 128
22
25/10/2023
133 134
135 136
23
25/10/2023
139 140
24