What it is.
The words, the images, the links.
<h1>Your Name</h1>
What it looks like.
Color, size, spacing, position.
h1 { color: red; }
What it does.
Things that happen when you click.
alert("hi");
A file called index.html, full of text you wrote.
Double-click it and your browser shows a website. No server. No internet.
That is the whole trick. Everything else today is detail.
<p> opens, </p> closes<img><p>I like <strong>pizza</strong>.</p>
Close them in the order you opened them. Inside first, outside last.
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Hello!</h1>
</body>
</html>
Information about the page. None of it shows up on screen. The title is the browser tab.
The page itself. Everything a visitor sees goes in here.
<body>.
<h1>Biggest heading</h1>
<h2>Smaller</h2>
<h3>Smaller still</h3>
<p>
A paragraph of ordinary text.
</p>
<p>
A second paragraph.
</p>
Headings, biggest to smallest. Use one h1 per page, then h2 for each section.
A paragraph. Every block of normal text goes in one.
<p>.
<ul>
<li>HTML</li>
<li>CSS</li>
<li>Python</li>
</ul>
<ol>
<li>Write the file</li>
<li>Open it</li>
<li>Put it online</li>
</ol>
Bullet points. Use it when the order does not matter.
Numbered. Use it for steps, rankings, anything where order carries meaning.
One per line in the list. Goes inside ul or ol, never on its own.
<a href="https://hacksu.com">
HacKSU
</a>
<a href="about.html">About me</a>
<a href="mailto:me@example.com">
Email me
</a>
href is where it goes. The text between the tags is what you click.
<img src="photo.jpg"
alt="A photo of me">
src is which file. alt describes it.
No closing tag. There is nothing to wrap around, so it stands alone.
h1 {
color: darkgreen;
font-size: 3rem;
}
p {
color: #333;
line-height: 1.6;
}
img {
width: 200px;
}
The name in front is what to find. Inside the braces is what to change.
<head>
<link rel="stylesheet"
href="style.css">
</head>
color, background, font-size,
padding, margin, width. That is enough to make a page yours.
<h1 id="title">Hello</h1>
<button id="go">Click me</button>
<script>
const title = document.getElementById("title");
const go = document.getElementById("go");
go.addEventListener("click", function () {
title.textContent = "You clicked it!";
});
</script>
getElementById grabs a tag by its id.
textContent replaces the words inside it.
addEventListener runs your code when something happens.
Here is a portfolio site built out of the tags you just learned. Download it, open it, start changing things.
CHANGE THISh1projects.html--accent in pages.css
Make an empty index.html, type the skeleton from earlier, and add tags until it
looks like something. Better practice, and you know enough now.
You cannot break anything. Refresh and try again.
No terminal. No Git. No build step. Drag, drop, live.
main, folder / (root)Slower to start, but free forever and it lives next to your code.