2.1-HTML
2.1-HTML
2
HTML5 Topics
Introduction of Basic Syntax
Basic Text Markups
Images
Hypertext links
Lists
Tables
Forms
Audio
Video
Organization elements
Time
3
References
References to all the HTML tags
http://www.w3schools.com/
https://developer.mozilla.org/en-
US/docs/Web/HTML/Reference?utm_source=chatgpt.
com
4
Tools you need for learning HTML5 and CSS5
An IDE or a plain text editor
IDE: VS Code + github copilot
Text editors:
Brackets (Mac)
GNU Emacs editor
Notepad ++
A browser
Run client side code
Developer tools: code inspector, network, command line
Google chrome, FireFox, MS Edge
You do not need a web server
5
Hello World in HTML5
<!DOCTYPE html>
<!-- greet.html A trivial document -->
<html lang = "en">
<head> <title> Our first document </title>
<meta charset="utf-8">
</head>
<body>
<p>
Hello World with HTML!
</body>
</html>
6
Load the greet.html into a browser
7
Understand what is a mark up language
<!DOCTYPE html>
<!-- greet.html A trivial document -->
<html lang = "en">
<head> <title> Our first document </title>
<meta charset="utf-8">
</head>
<body>
<p>
Hello World with HTML!
</p>
</body>
</html> chap2/greet.html
8
Understand what is a mark up language
10
With external CSS and JavaScript files
<!DOCTYPE html>
<!-- greet.html A trivial document -->
<html lang = "en">
<head>
<meta charset="utf-8">
<title> Our first document </title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
</body>
</html>
11
Minimal HTML5 file
<!DOCTYPE html>
<html lang = "en">
<head> <title> Our first document </title>
<meta charset="utf-8">
</head>
<body>
</body>
</html>
12
HTML5 Validator
https://validator.w3.org/
13
Basic Text Markups
14
Paragraph Elements <p>
-Text is normally placed in paragraph elements
- breaks the current line and inserts a blank line
<!DOCTYPE html>
<!-- greet.html A trivial document -->
<html lang = "en" >
<head> <title> Demo Paragraph</title>
</head>
<body>
<p> Greetings from your Webmaster! </p>
<p> This is the second paragraph. </p>
</body>
</html>
chap2/p1.html
15
Load greet.html into Browser
16
Line breaks <br>
- No closing tag!
- Breaks the current line, inserts No blank line
<!DOCTYPE html>
<!-- greet.html A trivial document -->
<html lang = "en" >
<head> <title> Our first document </title>
</head>
<body>
<p> Greetings from your Webmaster! </p>
<p> This is the second paragraph. <br> We continue the second
paragraph.</p>
</body>
</html>
chap2/br.html
17
Load br.html into Browser
18
Preserving whitespace <pre>
- The text content of a element is displayed as it is entered
20
Headings <h1> <h2> <h3> <h4> <h5> <h6>
- 1, 2, and 3 use font sizes that are larger than the default font
size
- 4 uses the default size
- 5 and 6 use smaller font sizes
<body>
<h1> Aidan’s Airplanes (h1) </h1>
<h2> The best in used airplanes (h2) </h2>
<h3> "We’ve got them by the hangarful" (h3)
</h3>
<h4> We’re the guys to see for a good used
airplane (h4) </h4>
<h5> We offer great prices on great planes
(h5) </h5>
<h6> No returns, no guarantees, no refunds,
all sales are final (h6) </h6>
<p> the default font for text, <b> the default bold
font for text</b></p>
<p>
<i> this is italic</i> <br>
<b> this is bold</b> <br>
<em> this is em</em> <br>
<strong> this is strong </strong> <br>
<code> this is code </code>
</p>
<p>
x<sub>2</sub><sup>3</sup>+y<sub>1</sub><sup>2</sup>
</p>
chap2/fonts_my.html
23
HTML Style
<tagname style="property:value;">
For example
this is <span style=“font-style:italic"> italic </span>
chap2/ fonts_my_style.html
chap2/ my_style.html
24
The HTML charset Attribute
<meta charset="UTF-8">
25
ASCII table
26
Unicode
Chinese, Japanese, Tibetan, Arabic, …
Ancient characters
Emoji
128513 ?
27
UTF-32
28
UTF-8
w, x, y represent 0 or 1
29
UTF-8
30
The HTML Character Entities
Result Description Entity Name Entity Number
31
The HTML Character Entities (2)
Result Description Entity Name Entity Number
😀
😄
😍
💗
32
Emojis
UTF-8 covers almost all of the characters and symbols
in the world
Emojis are also characters from the UTF-8 alphabet:
is 128516
is 128525
is 128151
https://www.w3schools.com/html/html_emojis.asp
33
Blockquotes <blockquote>
- To set a block of text off from the normal flow and
appearance of text
- Browsers often indent, and sometimes italicize
34
The <meta> element
(for search engines) Used to provide additional
information about a document, with attributes, not
content.
35
Important Markups
Images
Hypertext links
Lists
Tables
Forms
36
Image tag <img /> by example
Source file location
Size in pixels
37
Normal Image Formats
GIF (Graphic Interchange Format)
8-bit color (256 different colors)
animation
JPEG (Joint Photographic Experts Group)
24-bit color (16 million different colors)
Both use compression, but JPEG compression is better
Portable Network Graphics (PNG)
Relatively new
Should eventually replace both gif and jpeg
No data loss when reproduction
Support transparent background --> for logos
Other formats
WebP, bmp, tiff, ico
38
An Image Example
<!DOCTYPE html>
<html lang = "en">
…
<body>
<p>
1960 Cessna 210 <br>
577 hours since major engine overhaul<br>
1022 hours since prop overhaul <br>
<img src = "images/c210new.jpg" alt = "Picture of a Cessna 210"><br>
Buy this fine airplane today at a remarkably low price <br>
Call 999-555-1111 today!
</p>
</body>
</html>
39
An Image Example (continued)
chap2/image.html
40
Hypertext links <a href = > by example
Source file location or url
relative path is preferred
Text content
Hypertext reference
chap2/link.html
41
An Hypertext Link Example
<!-- link.html
An example to illustrate a link
-->
<html lang = "en">
<head> <title> Links </title>
</head>
<body>
<h1> Aidan's Airplanes </h1>
<h2> The best in used airplanes </h2>
<h3> "We've got them by the hangarful"
</h3>
<h2> Special of the month </h2>
<p>
1960 Cessna 210 <br>
<a href = "C210data.html">
Information on the Cessna 210 </a>
</p>
</body>
</html>
42
An Hypertext Link Example (Continued)
43
HTML Links – The target Attribute
Where to open the linked document.
The target attribute can have one of the following
values:
_self - Default. Opens the document in the same window/tab
as it was clicked
_blank - Opens the document in a new window or tab
_parent - Opens the document in the parent frame
_top - Opens the document in the full body of the window
44
A link built on an images
chap2/linkOnImage.html
45
Id: mark the target spot
id: the target spot
chap2/link_bookmark.html
46
HTML Link Colors
By default, a link will appear like this (in all
browsers):
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
You can change the link state colors, by using
CSS:
<style>
a:link{color: green; text-decoration: none; …}
a:visited {color: pink; …}
a:hover {color: red; text-decoration: underline; …}
a:active {color:yellow; …}
</style>
chap2/link_colors.html
47
The End
48