Professional Documents
Culture Documents
Lecture No 2
Lecture No 2
of ICT
HTML
Hyper Text
Markup Language
2
HTML
3
HTML
4
Where is HTML Used?
5
HTML basic structure
<html>
<body>
</body>
</html>
6
Basic HTML Document
7
Basic HTML Document
<HTML>
<HEAD>
<TITLE>Web programming</TITLE>
</HEAD>
<BODY>
HTML: This is what is displayed.
</BODY>
</HTML>
8
How HTML Works – Tags
• Tags are the way to tell the website how to style the
text.
9
The first rule of writing HTML code is to surround text with tags.
Tags give a meaning, such as a heading or a link, to a text.
10
Most HTML elements require a pair of tags, an opening
tag and a closing tag, with text inserted in between.
When using closing tags, make sure to put /.
11
Tags
12
HTML Block and
Inline elements
<img src="IMAGE.jpg">
HEADINGS and TEXT
Heading tags are used to format heading elements.
These tags range from <h1> to <h6>, <h1> being the largest
and <h6> being the smallest (※ h stands for heading.).
15
The <p> tag defines a paragraph (※ p stands for
paragraph).
The text enclosed by tags such as <h2> and <p> begin
on a new line.
16
The <h1>, <h2>, ..., <h6> tags are used according to the
size and importance of headings as shown below.
For text that is not a heading, let's use the <p> tag.
17
Lists
You can create a list item by enclosing the text
with <li> tags
18
The type of list items change depending on the tag you use.
With the <ul> tag, you can create bulleted lists.
When elements are "nested" like this, the enclosing element
becomes the parent and the enclosed elements become
its children.
19
For nested elements, it's a good practice to align code with indentation.
Although not required, indentation makes it easier to see the parent-
child relationship especially when your code becomes complicated
(※ to indent, press the "tab" key at the beginning of a line).
20
Images
21
Images
22
alt Attribute
23
Image Width and Height
You can use the style attribute to specify the width and height of
an image.
24
Images from Web
<img src="https://www.w3schools.com/images/w3schools_g
reen.jpg" alt="W3Schools.com">
25
Animated Images
26
Image as a Link
To use an image as a link, put the <img> tag inside the <a> tag:
<a href="default.asp">
<img src="smiley.gif" alt="HTML
tutorial" style="width:42px;height:42px;border:0;">
</a>
27
Links
○ Links can also be added
29
table element
○ Rows <tr>
○ Columns
○ Body <tbody>
30
table element
○ Tables start with a header row with the names of the
columns.
○ thead element starts the header area
○ tr element creates a row
○ th elements create cells in the header row
<table border="1">
○ tbody element begins the body (data) area <thead>
○ Same tr element creates a row <tr>
○ td elements create data cells in each row. <th> Month </th>
<th> Savings </th>
</tr>
<tbody>
<tr>
<td> January </td>
<td> $100 </td>
31
</tr>
Iframes
32
Embedding Other WebPages
• <iframe src="URL"></iframe>
• <iframe src="https://skillsfirst.org/about/"
width="500" height="300"> </iframe>
33
Google Calendar
• In settings, Google Calendar provides this HTML for
embedding a calendar:
• <iframe
• src="http://www.google.com/calendar/embed?
src=en.usa%23holiday
%40group.v.calendar.google.com"
• width="600" height="400"></iframe>
34
YouTube Video
35