HTML, CSS & JS, lesson 1
A web page is a text file written in HTML (HyperText Markup Language). HTML doesn't "run" like a program. It describes content: this is a heading, this is a paragraph, this is a link. The browser reads that description and draws the page.
Content is wrapped in elements. Most elements have an opening tag, some content, and a closing tag with a slash:
<h1> is the most important heading on the page. There are six levels, <h1> to <h6>.
Use them in order, like the outline of a document, not to make text bigger.<p> is a paragraph. The browser adds space above and below it.Elements can contain other elements. <strong> marks text as important and <em> adds
emphasis:
The browser collapses spaces and line breaks in your HTML into a single space. Indenting your code makes it easier to read but doesn't change the page. To start a new paragraph, use a new .
2 exercises to try what you just read.
<p>A complete HTML file has a <!doctype html> line, an <html> element, a <head> with
information about the page (like its <title>), and a <body> with everything you see. In
this course the editor fills in that skeleton for you, so you only write what goes inside
<body>.
Write the start of a recipe page:
<h1> with the text Weekend pancakes.<p>) with the text Ready in 20 minutes.simple wrapped in <strong>.Below the main heading, add two sections of the page, each with an <h2> and a paragraph:
<h2> saying Ingredients, followed by a <p> (any text).<h2> saying Steps, followed by a <p> (any text).Keep the existing <h1>.
<h1>Weekend pancakes</h1>
<p>Fluffy, quick, and good with anything.</p><p>Rest the batter for <strong>ten minutes</strong>. It <em>really</em> helps.</p>