HTML Basics
Build your very first webpage. 5 short tasks — tags, headings, paragraph, link, image. No prior knowledge needed.
Your first HTML page
HTML basics: your first web page
HTML (HyperText Markup Language) is the language web pages are built in. HTML uses tags (markers in angle brackets) to describe what an element is — a heading, a paragraph, a link, an image.
Key terms
- Tag: a marker like
<p>(start) and</p>(end). The content goes in between. - Element: a complete tag pair with content, e.g.
<h1>Title</h1>. - Attribute: extra info inside a tag, e.g.
hrefon a link orsrcon an image.
Work in the file
/home/student/website/index.html. Create the folder:mkdir -p /home/student/website. Edit the file withnano /home/student/website/index.html.
Your goal
You build a complete small web page: skeleton, heading, paragraph, link and image.
Exercises
1. Doctype + html tag
Concept: the skeleton. Every HTML page starts with
<!doctype html>(tells the browser "this is HTML5") and wraps everything in<html>...</html>.Create the folder and write the skeleton (
nano /home/student/website/index.html):<!doctype html> <html> <head><title>My page</title></head> <body> </body> </html>Check:
index.htmlcontains<!doctype html>and an<html>...</html>element.2. A heading
Concept: heading
<h1>. The most important heading on a page is<h1>. Add it inside<body>.<h1>Welcome to my page</h1>Check:
index.htmlcontains an<h1>element with text.3. A paragraph
Concept: paragraph
<p>. Body text goes in a paragraph tag<p>. Add a paragraph with at least one short sentence.<p>This is my first own web page, which I built myself.</p>Check:
index.htmlcontains a<p>element with at least 10 characters of text.4. A link
Concept: link
<a>withhref. A link leads to another page. The tag is<a>, the target is in thehrefattribute.<a href="https://techlogia.de">To techlogia</a>The URL must start with
http://orhttps://.Check:
index.htmlcontains an<a>element withhref="https://...".5. An image
Concept: image
<img>withsrcandalt. You embed an image with<img>:srcis the image source,altis a description text (important for accessibility and if the image fails to load).<img src="https://picsum.photos/200" alt="A random example image">Check:
index.htmlcontains an<img>element withsrcandalt.
Related courses
Now practice it yourself
Reading is good – doing is better. Start this course on a real Linux VM, right in your browser. A free account is all it takes.
Start for freeLab content under CC BY 4.0 – free to use with attribution (© TechLogia).
