Learn Html with Kbdk: How does HTML describe the structure of pages?
- To describe the structure of a web page, we add code to the words we want to appear on the page.
- You can see the HTML code for this page below. Don't worry about what the code means yet. We start to look at it in more detail on the next page.
- Note that the HTML code is in blue, and the text you see on the screen is in yellow.
<html>
<body>
<h1>This is the Main Heading</h1>
<p>This text might be an introduction to the rest of
the page. And if the page is a long one it might
be split up into several sub-headings.</p>
<h2>This is a Sub-Heading</h2>
<p>Many long articles have sub-headings so to help
you follow the structure of what is being written.
There may even be sub-sub-headings (or lower-level
headings).</p>
<h2>Another Sub-Heading</h2>
<p>Here you can see another sub-heading.</p>
</body>
</html>
- The HTML code (in blue) is made up of characters that live inside angled brackets — these are called HTML elements.
- Elements are usually made up of two tags: an opening tag and a closing tag. (The closing tag has an extra forward slash in it.)
- Each HTML element tells the browser something about the information that sits between its opening and closing tags.
- In this way, HTML describes the way how to describe the structure of pages.
- Tim Berners-Lee discovered HTML in 1990 the age when the internet was barely popular.