HTML
🎬 This chapter has a 12:38 video: Web Services →A web page looks like headings, paragraphs, pictures and links. But the file the web server sends is just text — text with little labels in angle brackets that tell the browser what each part is. Those labels are HTML.
1What HTML is
- HyperText: text with links to other pages.
- Markup: marking parts of the text with tags — this is a heading, this is a paragraph.
- Language: a fixed set of those tags, with rules for using them.
Take the page apart or put it together, and switch elements on and off. Drag sideways to turn.
<html>
<head>
<title>My School</title>
</head>
<body>
<h1>My School</h1>
<p>Welcome to our website.</p>
<img src="school.jpg">
<a href="contact.html">Contact us</a>
</body>
</html>2Tags
A tag is a word inside angle brackets. Most tags come in pairs: an opening tag like <p> and a closing tag with a slash, </p>. Whatever is between them is what the tag describes. A few tags, like <img>, have no closing tag.
| Tag | Means | Shown as |
|---|---|---|
| <html> … </html> | The whole document | (everything) |
| <head> … </head> | Information about the page, such as its <title> | The name on the browser tab |
| <body> … </body> | Everything that appears on the page | The page itself |
| <h1> … </h1> | A main heading | Big, bold text |
| <p> … </p> | A paragraph | A block of text |
| <img src="school.jpg"> | A picture | The image |
| <a href="contact.html"> … </a> | A hyperlink | Clickable text that opens another page |
HTML’s tags are predefined: you must use the ones the language has — you cannot invent a <marks> tag and expect a browser to know what it means. HTML is not case-sensitive: <P> and <p> are the same tag.
3From the board papers
▶Show the answer
b) HTML. CSS styles the page, JavaScript makes it interactive, and FTP is a protocol.
▶Show the answer
(B) Language — HyperText Markup Language.
▶Show the answer
HyperText Markup Language.
4Check yourself
Which tag makes a hyperlink to another page?
Where does the text inside <title> appear?