In the simple web page, just like a human, it must contain head and body.
<!DOCTYPE html>
<html>
<head>
<title>My first web page</title>
</head>
<body>
<img src="images/doggy.jpg" alt="" />
<p>@Paul Lu</p>
<p>I love Frontend Dev</p>
</body>
</html>
In the case above, we have created the head by have <head> ... </head>
and the body with <body> ... </body>
<title>
indicates the name of the tab in your browser.<p>
indicates plain text.<img>
is a special tag as it doesn’t have closing tag. i.e. </img>
. It has 2 parameters:
src=
the image location (source)alt=
display if the image fails to display, name of the image (alternative)