WEEK 2 Notes
2.2 The Basic Structure of Every HTML Page
|
Basic HTML Document Structure |
|
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>My First Newgate University Web Page</title> |
|
</head> |
|
<body> |
|
<!-- Everything the user sees goes here --> |
|
<h1>Welcome to Newgate University Minna</h1> |
|
<p>This is my very first web page!</p> |
|
</body> |
|
</html> |
|
Tag / Element |
Purpose |
Example |
|
<!DOCTYPE html> |
Tells the browser this is an HTML5 document |
Always the very first line |
|
<html> |
The root element — wraps everything |
<html lang="en">...</html> |
|
<head> |
Contains invisible information about the page (title, metadata, links) |
<head>...</head> |
|
<meta charset> |
Sets character encoding — required for special characters (ó, é, etc.) |
<meta charset="UTF-8"> |
|
<title> |
The text shown on the browser tab |
<title>Newgate University</title> |
|
<body> |
All visible content goes here |
<body>...</body> |
|
<!-- comment --> |
A note for developers — not shown to users |
<!-- This is a note --> |