back

how to html

page structure

here's the minimal requirement for a page:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>very good page</title>
    </head>
    <body>
        <!-- whatever you want! -->
    </body>
</html>

you can save this to a file ending in .html if you want. if you then open it in a browser you'll see...

...oh that's not very much. here's what this does:

you technically don't need to explicitly mark <html> or <head> or <body>, the browser will do it for you, but it's a good idea to anyway.

now let's add actually Useful stuff.

basic formatting

like paragraphs! those are fun. to make a paragraph, wrap it in a <p>...</p>.

<body>
    <p>wheeeee im a paragraph</p>
    <p>so am i! :3</p>
</body>

ssy you want to have fancy bold or italic text. there sre two ways to do this:

'regular' semantic
(emphasis)
bold <b> <strong>
italic <i> <em>

the 'regular' ones are for when you just want the formatting:

<p><b>HTML</b> <i>n.</i> HyperText Markup Language</p>

the other two specifically mean you're emphasizing something:

<p><strong>Warning!</strong> Do <em>not</em> eat too many pickles</p>

there's a similar distinction for underline and strikethrough:

'regular' semantic
underline - <u>
<ins>
strikethrough <s> <del>

there is no non-meaningful way to underline stuff without using Magic that i'll tell you about later. <u> is for crap like *checks notes*

<u>speling</u> <u>erors</u>

<ins> and <del> mark inserted and deleted text.

another thing you can do is make headings. there are six levels called <h1> through <h6>.

<h1>how to html</h1>
<h2>Chapter 37.</h2>
<!-- etc -->