A web page is a text file written in HTML. The site sends the file, and the browser reads it and draws the screen. HTML is made of elements: an opening tag, the content, and a closing tag, which is the same name with a slash in front. An opening tag can also carry an attribute: a name, an equals sign, and a value in quotes.
Here is a paragraph from another page, with an attribute in its opening tag:
<p class="note">Open every day.</p>
Every page has the same frame. The first line is the doctype, <!doctype html>, which tells the browser this is a modern HTML page. Then one html element holds the page's two parts. The head holds facts about the page, which are not drawn on it. Its title is the name the browser shows on the tab. The body holds everything the visitor sees.
The check opens your page and prints the screen, one line per thing a visitor sees, and then the tab's title. Your page must give:
> open the page
screen:
heading 1: Corner Shop
text: Mugs, lamps, plants and more, a short walk from home.
> the tab's title
Corner ShopYour task: start from an empty index.html. Write the doctype and an html element with lang="en". Inside it, put a head with the title Corner Shop, and a body with an h1 that says Corner Shop and a paragraph that says Mugs, lamps, plants and more, a short walk from home.
Assignment
Follow the Coding Tutorial to build the Corner Shop's first page: the doctype, the html element, a head with the tab's title, and a body with a heading and a paragraph.
Hint
Every opening tag needs its closing tag. When one element sits inside another, the inner one closes first, so </title> comes before </head>. The title goes in the head, and the h1 and the p go in the body.
Free plan: 30 tutor messages. PRO is unlimited.
