Unit 1 home
FSWD · MERN CLASS 4 / 48 60-MIN SESSION LAST STOP BEFORE LAB 1
CLASS 4 · P 1/16PGDN NEXT LINE / POINT · PGUP BACK
UNIT 1 · WEB BASICS, HTML & CSS PART A · CLASS 4 OF 12 UI23PC510CS · THEORY

Today's craft

Linking — anchors, navigation & your first multi‑page site.

For three classes, everything you built lived on one lonely page. Today you meet the tag that turned isolated documents into a web — and before this hour ends, you will have written, saved and clicked through your own three-page website. Every skill Lab 1 needs is on today's table.

Walk out of this room able to…

Read & write any <a> tag — its attribute, value and link text
Choose correctly between a relative and an absolute path — every time
Wire three separate files into one navigable site
Jump straight to any section of a long page with id + #fragment
THE HOUR, POINT BY POINT
01Warm-up — today's promise: a real multi-page siteIDEA
02What a hyperlink actually isIDEA
03Anatomy of the <a> tag — built one line at a timeIDEA
04Relative vs absolute paths — the #1 beginner bugIDEA
05Build the mini-site: index · menu · aboutTRY IT
06External links & email linksIDEA
07Complete the Campus Nav — fill in the codeTRY IT
08Campus Nav — worked solutionSOLUTION
09Build-order shuffle — how a multi-page site gets madeTRY IT
10Build-order — worked solutionSOLUTION
11Jump links at real scale — the full 10-dish Poshtik menuIDEA
12DevTools challenge — find the <a> behind the Menu linkTRY IT
13DevTools — worked solutionSOLUTION
14Accessibility audit — does every link make sense alone?TRY IT
15Audit — worked solutionSOLUTION
16Wrap-up, sandbox map & the road to Lab 1IDEA
BEFORE CLASS 4 STARTS · DOWNLOAD THE IMAGE PACK

Point 11 builds the full Poshtik Campus menu, and its photos come from today's asset pack — the branded dish cards, packaged once as a single ZIP. Unzip it and copy the images/ contents into your own menu-full/assets/ folder when we get there. This link lives on this page only; later points just name the files.

Part 2 · The big idea

One small tag made it a web.

Documents existed long before 1991. Libraries were full of them. What no document could do was carry you to another one by touch. A hyperlink is exactly that: a piece of text — or an image — that holds the address of another document, and hands your browser that address the moment you click.

A world without links

Every page is an island. To read a related document you must already know its full address, type it perfectly, and hope you made no mistake. Ten documents means ten addresses memorised. Knowledge exists — but it doesn't connect.

A world with links

Any word can be a doorway. The address travels inside the page itself — you just click. Follow a link, then another, then another: that click-to-click journey is why the whole system is called a web, and the program you follow it with is called a browser.

This is the "HT" in HTML.

HTML = HyperText Markup Language. "Hypertext" means text that goes beyond flat text — text with live connections inside it. Headings, paragraphs and images were the warm-up; the hyperlink is the feature the whole language is named after.

GO DEEPER · ON YOUR OWN

The very first website — Tim Berners-Lee's info.cern.ch, 1991, which you met in Class 1 — was little more than a short page of hyperlinks. No colours, no images, no layout. The links alone were revolutionary: for the first time, "see document X" was something you could do, not just read.

Count your own clicks after class: from any news homepage to a story, to a related story, to a source. Each hop is one <a> tag doing exactly what you learn to write today.

Part 3 · The tag itself

Anatomy of <a> — four parts, one job.

The tag is called a for anchor. It wraps the text a visitor clicks, and its href attribute — hypertext reference — carries the destination address. Learn to read these four parts and no link on any website will ever be a mystery again.

<athe anchor tag opens    hrefattribute — "hypertext reference": where to go =  "menu.html"value — the destination address >  See today's menulink text — what the visitor reads & clicks </a>the anchor closes
MINI PROBLEM · ANCHOR-DEMO.HTML
PROBLEM
Write your first working hyperlink: a one-page Poshtik teaser whose link points at a menu.html that doesn't exist yet — so you can see exactly what the browser does with a link, and with a missing destination.
REQUIRE­MENTS
  • Save as anchor-demo.html inside class-04 · title text: My first hyperlink
  • Full skeleton, an <h1>, one paragraph of pitch text
  • One anchor: <a href="menu.html">See today's menu</a> — a bare relative filename, no scheme
EXPECTED OUTPUT
Heading, paragraph, and a blue underlined link you styled in no way whatsoever. Hovering shows a pointing hand; clicking asks for menu.html — which 404s until Part 5 makes it real.
anchor-demo.htmlBUILDS ONE LINE PER PRESS
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>My first hyperlink</title>
6 </head>
7 <body>
8 <h1>Poshtik Campus</h1>
9 <p>Hungry between classes? We deliver during break hours.</p>
10 <a href="menu.html">See today's menu</a>
11 </body>
12</html>
My first hyperlink
file:///C:/Users/student/Desktop/fswd-practice/class-04/anchor-demo.html
Poshtik Campus

Hungry between classes? We deliver during break hours.

See today's menu

Blue and underlined, with no styling from us — the browser dresses every link this way by default. And notice the tab above: the moment the <title> line landed, the tab took its name. Clicking the link asks for menu.html… which doesn't exist yet. Try it — click the link and see the browser's honest answer. We fix that in Part 5.
menu.html
file:///C:/Users/student/Desktop/fswd-practice/class-04/menu.html
Your file couldn't be accessed

It may have been moved, edited or deleted.

ERR_FILE_NOT_FOUND

← Back to anchor-demo.html

This is the REAL output of that click: the browser asked for menu.html beside anchor-demo.html, found nothing, and said so. A link is a promise — Part 5 keeps this one by actually writing the file.
SAVE THIS AS
FOLDERC:\Users\student\Desktop\fswd-practice\class-04\
FILENAMEanchor-demo.html
THENDouble-click the file — it opens in your browser. Hover the link and watch the cursor become a pointing hand.
GIT?No — fswd-practice\ is the throwaway sandbox, never a repo. Zero commits in this class; version control waits for poshtik-campus\ work.

GO DEEPER · WHY "ANCHOR"?

The name comes from print and early hypertext research: a link needs a fixed point in the text where it is anchored — the words you attach the destination to. The destination side got the matching name you'll meet in Part 11: an anchor point, marked today with an id.

One more default you already saw in the preview: after you visit a link, most browsers repaint it purple instead of blue — a 30-year-old convention that quietly answers "have I already read this?" everywhere on the web.

Part 4 · Addresses

Relative vs absolute — the #1 multi-page bug.

Every href is an address, and addresses come in two kinds. Mix them up and you get the single most common beginner bug in multi-page sites: a site that works perfectly on your laptop and breaks on everyone else's. Here is the folder we're about to build — keep your eye on it.

FSWD-PRACTICE \ CLASS-04 \ MINI-SITE
mini-site\
├─ index.html <- you are standing here
├─ menu.html
├─ about.html
└─ assets\
   └─ poshtik-logo.jpg
Relative path — directions from here

"From where this file lives, go to…" — href="menu.html" means the file sitting beside me; href="assets/poshtik-logo.jpg" means step into my assets folder, take the logo. No drive letters, no domain. Move the whole folder anywhere — pen drive, another laptop, a real server — and every relative link still works, because the files kept their positions relative to each other.

Absolute path — the full postal address

The complete address from the top: https://www.vce.ac.in/. It works from anywhere on Earth — and that is exactly its job: linking to other people's sites. Between your own pages it's the wrong tool: the address pins your site to one exact location, and the moment the site moves, every such link snaps.

The classic bug, so you recognise it on sight.

A student writes href="C:\Users\priya\Desktop\fswd-practice\class-04\mini-site\menu.html". On Priya's laptop it works — the browser finds the file at that disk address. Submitted to the instructor, hosted on a server, opened on any other machine: broken link, because no other computer has Priya's folders. The rule that prevents it forever: your own pages take relative paths · other sites take absolute URLs.

GO DEEPER · GOING UP A LEVEL

Going down into a folder is a name and a slash: assets/poshtik-logo.jpg. Going up one level is two dots: from a file inside assets/, ../index.html means "step out of this folder, then find index.html". You won't need .. today — the mini-site keeps all three pages side by side on purpose — but you'll meet it the moment a project grows its first sub-page folder.

Quick self-check, standing in index.html: the logo is assets/poshtik-logo.jpg ✓ · the menu is menu.html ✓ · the college website is absolute, https://www.vce.ac.in/

Part 5 · Build it

Three files. One site. Your first.

Everything so far was one page pointing at nothing. Now we make the destinations real: a home page, a menu page and an about page, all inside mini-site/ — the folder tree you just studied. Each file is complete on its own; the links are what turn three files into one site.

File 1 of 3 — index.html, the front door

MINI PROBLEM · MINI-SITE/INDEX.HTML
PROBLEM
Build the front door of a three-page site: a home page that links out to a menu page and an about page sitting beside it in the same folder.
REQUIRE­MENTS
  • Save as index.html inside class-04\mini-site\ · title text: Poshtik Campus · Home
  • <h1> + one tagline paragraph
  • Two links, each in its own <p>: href="menu.html" and href="about.html" — bare relative filenames only
EXPECTED OUTPUT
Heading, tagline, two links. Both links 404 for now — files 2 and 3 of this Part make them work.
mini-site/index.htmlBUILDS ONE LINE PER PRESS
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Poshtik Campus · Home</title>
6 </head>
7 <body>
8 <h1>Poshtik Campus</h1>
9 <p>Healthy food, healthy body, healthy mind — delivered during break hours.</p>
10 <p><a href="menu.html">See the menu</a></p>
11 <p><a href="about.html">About us</a></p>
12 </body>
13</html>
Poshtik Campus · Home
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/index.html
Poshtik Campus

Healthy food, healthy body, healthy mind — delivered during break hours.

See the menu

About us

Both hrefs are bare filenames — pure relative paths. The browser will look for them beside this file, in the same mini-site/ folder. Right now the folder holds only this one file — click either link and watch both promises fail honestly. Files 2 and 3 keep them.
menu.html
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/menu.html
Your file couldn't be accessed

It may have been moved, edited or deleted.

ERR_FILE_NOT_FOUND

← Back to index.html

The relative path did its half of the job — the browser looked beside index.html. There's just no menu.html there yet. File 2 of 3, coming right up.
about.html
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/about.html
Your file couldn't be accessed

It may have been moved, edited or deleted.

ERR_FILE_NOT_FOUND

← Back to index.html

Same story as the menu link: right folder, missing file. about.html is File 3 of 3.
SAVE THIS AS
FOLDERC:\Users\student\Desktop\fswd-practice\class-04\mini-site\
FILENAMEindex.html — one of THREE linked files landing in this same folder this session
WHY "index"?It's the filename web servers serve automatically when a visitor asks for a folder — the universal name for "the front door".
GIT?No — even a "real" three-file site stays uncommitted while it lives inside the fswd-practice\ sandbox.

File 2 of 3 — menu.html, where the links lead

MINI PROBLEM · MINI-SITE/MENU.HTML
PROBLEM
Make the home page's first link real: a menu page with a taster list of dishes — and a return link, because navigation that only works one way strands your visitor.
REQUIRE­MENTS
  • Save as menu.html in the same mini-site\ folder as index.html — exactly this name, lowercase
  • Title text: Poshtik Campus · Menu · <h1> Today's Menu
  • A <ul> of three dishes
  • A return link: <a href="index.html">Back to home</a>
EXPECTED OUTPUT
Heading, three bulleted dishes, a Back to home link. From index.html, "See the menu" now actually arrives here — and Back returns.
mini-site/menu.htmlBUILDS ONE LINE PER PRESS
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Poshtik Campus · Menu</title>
6 </head>
7 <body>
8 <h1>Today's Menu</h1>
9 <ul>
10 <li>Jonna Rotte Wrap</li>
11 <li>Ragi Idli Bowl</li>
12 <li>Millet Protein Shake</li>
13 </ul>
14 <p><a href="index.html">Back to home</a></p>
15 </body>
16</html>
Poshtik Campus · Menu
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/menu.html
Today's Menu
  • Jonna Rotte Wrap
  • Ragi Idli Bowl
  • Millet Protein Shake

Back to home

A taster of three dishes for now — Part 11 builds the full ten-dish menu at real scale. Note the return link: navigation must work in both directions, or visitors get stranded. And index.html already exists, so Back to home is real — click it. From there, About us still fails: File 3 is next.
Poshtik Campus · Home
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/index.html
Poshtik Campus

Healthy food, healthy body, healthy mind — delivered during break hours.

See the menu

About us

Back on index.html — a real round trip. See the menu ⇄ Back to home now works both ways. About us? Still a promise nobody kept. Click it.
about.html
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/about.html
Your file couldn't be accessed

It may have been moved, edited or deleted.

ERR_FILE_NOT_FOUND

← Back to index.html

Two files down, one to go — about.html is the last unkept promise on the site.
SAVE THIS AS
FOLDERC:\Users\student\Desktop\fswd-practice\class-04\mini-site\ — same folder as index.html, or the relative links break
FILENAMEmenu.html — exactly this, lowercase. The name must match every href="menu.html" letter for letter.
GIT?Same answer as index.html — sandbox file, no repo, no commit.

File 3 of 3 — about.html, and the loop closes

MINI PROBLEM · MINI-SITE/ABOUT.HTML
PROBLEM
Close the triangle: the third and final page, so every link on the site — forward and back — lands on a real file.
REQUIRE­MENTS
  • Save as about.html in the same mini-site\ folder · title text: Poshtik Campus · About
  • <h1> + one paragraph about the project
  • A return link to index.html
EXPECTED OUTPUT
Open index.html and click your way around: home ⇄ menu, home ⇄ about — the address bar changes file names as you move. That is a multi-page site working.
mini-site/about.htmlBUILDS ONE LINE PER PRESS
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Poshtik Campus · About</title>
6 </head>
7 <body>
8 <h1>About Poshtik Campus</h1>
9 <p>Made fresh in the campus canteen, delivered to classrooms and hostels during break hours.</p>
10 <p><a href="index.html">Back to home</a></p>
11 </body>
12</html>
Poshtik Campus · About
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/about.html
About Poshtik Campus

Made fresh in the campus canteen, delivered to classrooms and hostels during break hours.

Back to home

Save this one and the triangle is complete: home ⇄ menu, home ⇄ about. Open index.html and click your way around your own website — every link in this very preview is now real. Try the full triangle right here.
Poshtik Campus · Home
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/index.html
Poshtik Campus

Healthy food, healthy body, healthy mind — delivered during break hours.

See the menu

About us

No more error pages anywhere: both links land. This is the moment the folder of files became a website.
Poshtik Campus · Menu
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/menu.html
Today's Menu
  • Jonna Rotte Wrap
  • Ragi Idli Bowl
  • Millet Protein Shake

Back to home

The address bar reads menu.html — served on request, return link ready.
SAVE THIS AS
FOLDERC:\Users\student\Desktop\fswd-practice\class-04\mini-site\
FILENAMEabout.html
THENDouble-click index.html. Click Menu, then Back, then About, then Back. Watch the address bar change file names as you move — that is a multi-page site working.
GIT?No — the triangle is complete, but the sandbox rule holds: nothing in fswd-practice\ ever gets committed. When this exact pattern grows into poshtik-campus\ in Lab 1, that version is repo material.
Mark this moment.

Three classes ago you had never written a tag. You now own a working, navigable, multi-page website — built with nothing but a text editor and three small files. Lab 1's poshtik-campus/ site is this exact pattern, grown larger.

Now click around it — right here.

This preview is LIVE: the three pages you just typed, wired together exactly as the browser wires them. Click See the menu — the address bar changes, the tab changes, the menu page loads. Click Back to home and you return. This is the complete output of your three files, working as one site:

LIVE MULTI-PAGE PREVIEW · EVERY BLUE LINK REALLY WORKS — CLICK THEM
Poshtik Campus · Home
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/index.html
Poshtik Campus

Healthy food, healthy body, healthy mind — delivered during break hours.

See the menu

About us

You are on index.html — the front door. Both links below are one click from a sibling file.
Poshtik Campus · Menu
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/menu.html
Today's Menu
  • Jonna Rotte Wrap
  • Ragi Idli Bowl
  • Millet Protein Shake

Back to home

The address bar now reads menu.html — your click asked for the sibling file and the browser served it. Return link below: navigation works in both directions.
Poshtik Campus · About
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/about.html
About Poshtik Campus

Made fresh in the campus canteen, delivered to classrooms and hostels during break hours.

Back to home

Third corner of the triangle — about.html. Every link on the site now lands on a real file.

GO DEEPER · SHARED NAV, AND A PAIN YOU SHOULD FEEL

Real sites repeat the same navigation links on every page, not just the home page. Try it: paste the two links from index.html into the top of menu.html and about.html too. Now change one link's text — you must edit it in three places. Annoying? Good. Remember that annoyance: much later in this course, components and templating exist precisely to remove it. You can't appreciate the fix before you've felt the problem.

Part 6 · Leaving the site

Links that leave — other sites, and email.

Your mini-site's links all stay in the family. Two more link kinds complete the toolkit: an external link that opens someone else's website in a new tab, and a mailto: link that opens the visitor's email app with the address pre-filled.

MINI PROBLEM · OUTSIDE-LINKS.HTML
PROBLEM
Write the two link kinds that leave your site: an external link that opens another website in a new tab, and a mailto: link that opens the visitor's email app pre-addressed.
REQUIRE­MENTS
  • Save as outside-links.html at the class-04 root · title text: Links that leave the site
  • External link to https://www.vce.ac.in/ with BOTH target="_blank" and rel="noopener" — the pair always travels together
  • Email link: href="mailto:orders@poshtikcampus.in"
EXPECTED OUTPUT
Two ordinary-looking links. Clicking the first opens the college site in a new tab (your page stays put); clicking the second opens the email app with the address filled in.
outside-links.htmlBUILDS ONE LINE PER PRESS
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Links that leave the site</title>
6 </head>
7 <body>
8 <h1>Find us beyond this site</h1>
9 <p><a href="https://www.vce.ac.in/"
10 target="_blank" rel="noopener">Vasavi College website</a></p>
11 <p><a href="mailto:orders@poshtikcampus.in">Email your order</a></p>
12 </body>
13</html>
LIVE OUTPUT · BOTH LINKS REALLY WORK — CLICK THEM
Links that leave the site
file:///C:/Users/student/Desktop/fswd-practice/class-04/outside-links.html
Find us beyond this site

Vasavi College website

Email your order

Both look like any other link — the difference is entirely in what a click does. And these two are real: the first genuinely opens the Vasavi College site in a new tab (this page stays put — that's target="_blank" working); the second genuinely opens your email app, addressed and ready. Try both. Notice afterwards the college link turns purple — the browser's own visited-link default.
SAVE THIS AS
FOLDERC:\Users\student\Desktop\fswd-practice\class-04\ — a single-file demo, so it stays at the class root
FILENAMEoutside-links.html
GIT?No — one-file sandbox demo. Not tracked, not committed.
target="_blank" — open in a new tab

Without it, clicking the college link would replace your page — the visitor leaves your site. With it, the college opens in a new tab and your site stays put. Convention: use it for links that leave your site; never for your own pages, where tab-spawning just irritates.

mailto: — a link to a person

The href doesn't have to be a page at all. mailto:orders@poshtikcampus.in tells the browser: open the email app, addressed and ready. No form, no server — the humble contact link that still powers half the "Contact us" footers on the web.

Why rel="noopener" rides along with target="_blank".

A page opened in a new tab can — through an old browser loophole — reach back and redirect the tab that opened it. rel="noopener" slams that door. You don't need the full security story yet; you need the habit: the two attributes travel as a pair. Type one, type both.

GO DEEPER · THE SCHEME PREFIX

Look at what comes before the colon in each href you've written today: https:, mailto:. That prefix is called the scheme — it tells the browser what kind of action the address needs. https: = fetch a page securely; mailto: = compose an email; your bare menu.html has no scheme at all, which is exactly what marks it as relative. Phone links exist too: tel:+914023146003 dials on a phone.

YOUR TURN · FILL IN THE CODE

Complete the Campus Nav.

A navigation list for the mini-site, three quarters written. Three href values are missing — the rest of the file is untouchable. Write the three missing addresses.

Setup: this file will be saved into class-04\activities\ — which means it does not sit beside the mini-site's pages. For this exercise, pretend it does: fill each gap as if this file lived inside mini-site\, right next to its three pages.

Rules:

  • Every answer is a relative path.
  • No C:\, no https://, no folder names needed.
  • Spelling and case must match the real filenames exactly.
activities/nav-practice.htmlBUILDS ONE LINE PER PRESS
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Campus Nav — fill me in</title>
6 </head>
7 <body>
8 <ul>
9 <li><a href="__________ ①">Home</a></li>
10 <li><a href="__________ ②">Today's Menu</a></li>
11 <li><a href="__________ ③">About us</a></li>
12 </ul>
13 </body>
14</html>
Campus Nav — fill me in
file:///C:/Users/student/Desktop/fswd-practice/class-04/activities/nav-practice.html
  • Home
  • Today's Menu
  • About us
Here's the trap this activity teaches: the page looks finished — three tidy blue links — even with every href still blank. A link's looks tell you nothing about whether it works. Only the address does. Don't take my word for it — click any of the three.
__________
file:///C:/Users/student/Desktop/fswd-practice/class-04/activities/__________
Your file couldn't be accessed

It may have been moved, edited or deleted.

ERR_FILE_NOT_FOUND

← Back to nav-practice.html

The browser did exactly what it was told: it asked for a file literally named the blank — and found nothing. Pretty pixels, broken promise. Your three answers fix this.
SAVE THIS AS
FOLDERC:\Users\student\Desktop\fswd-practice\class-04\activities\ — activity files get their own subfolder from this class on
FILENAMEnav-practice.html
GIT?No — activity scratch files live and die in the sandbox.

Commit to your three answers first — on paper or in the box above.

WORKED SOLUTION · CAMPUS NAV

Three bare filenames — nothing more.

nav-practice.html — solvedBUILDS ONE LINE PER PRESS
8 <ul>
9 <li><a href="index.html">Home</a></li>
10 <li><a href="menu.html">Today's Menu</a></li>
11 <li><a href="about.html">About us</a></li>
12 </ul>
Campus Nav — fill me in
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/nav-practice.html
  • Home opens index.html ✓
  • Today's Menu opens menu.html ✓
  • About us opens about.html ✓
Identical pixels to the unsolved version — but now every click lands. Same look, working site. Prove it: click any of the three.
Poshtik Campus · Home
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/index.html
Poshtik Campus

Healthy food, healthy body, healthy mind — delivered during break hours.

See the menu

About us

The bare filename index.html landed exactly where it promised. ← Back to nav-practice.html
Poshtik Campus · Menu
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/menu.html
Today's Menu
  • Jonna Rotte Wrap
  • Ragi Idli Bowl
  • Millet Protein Shake

Back to home

Second answer verified — menu.html, exact spelling, exact case. ← Back to nav-practice.html
Poshtik Campus · About
file:///C:/Users/student/Desktop/fswd-practice/class-04/mini-site/about.html
About Poshtik Campus

Made fresh in the campus canteen, delivered to classrooms and hostels during break hours.

Back to home

Third answer verified — all three bare filenames land. ← Back to nav-practice.html
Why each wrong instinct is wrong.

C:\Users\...\index.html — works only on your machine (Part 4's classic bug). https://poshtikcampus.in/menu.html — the site isn't hosted anywhere yet; and even when it is, internal links shouldn't pin themselves to one domain. mini-site/menu.html — you were told to stand inside mini-site; from there the extra folder name looks for mini-site\mini-site\menu.html, which doesn't exist. Bare filename: correct from all three angles.

Score yourself honestly
  1. All three bare filenames, exact spelling — full marks, you've beaten the #1 multi-page bug.
  2. Right idea but wrote Menu.html or About.HTML — half marks; a hosted Linux server treats case as different files, so the habit matters now.
  3. Used a full C:\ or https:// path — re-read Part 4's red card, then redo all three from scratch. This exact confusion is what the activity exists to catch.
YOUR TURN · PUT IT IN ORDER

The build-order shuffle.

Four things happen every time anyone — student or professional — builds a multi-page site. Below they've been shuffled. Write the correct order, and for each step, one line on why it can't come earlier. This exact sequence is the workflow you'll run in Lab 1.

NAVWrite the shared navigation

Draft the set of links every page will carry — Home · Menu · About — as one <ul> of anchors.

PLANPlan the pages

Decide, on paper, what pages the site needs and what each one is called. No editor open yet.

TESTLink everything & click-test

Point every href at its real file, then open the site and click down every path, both directions.

FILESCreate the files

Make the folder, create one .html file per planned page, each with a full valid skeleton.

Lock in your order first — the "why" lines are where the marks live.

WORKED SOLUTION · BUILD ORDER

Plan. Files. Nav. Test.

1
PLAN — Plan the pages

Everything downstream copies this decision: filenames become hrefs become the nav. Change your mind after step 3 and you're editing every file. Paper is the cheapest place to be wrong.

2
FILES — Create the files

Can't come before PLAN: you'd be inventing filenames with no plan. Must come before NAV: a nav written first points at files that don't exist yet — every link a guess.

3
NAV — Write the shared navigation

Now every href names a file that is really on disk — no guessing, no typo-by-memory. This is also the step you'll feel in Lab 1: same nav, pasted into every page of poshtik-campus/.

4
TEST — Link everything & click-test

Testing is last because it tests everything before it: plan, filenames, nav, paths. Click every link on every page, both directions. A link you never clicked is a link you don't know works.

This is Lab 1's script, one week early.

In Lab 1 you'll run exactly Plan–Files–Nav–Test on a fresh poshtik-campus/ folder: plan its pages, create the files, write one shared nav, link and click-test. Walk in with this order in your head and the lab becomes execution, not discovery.

Score yourself honestly
  1. Order exactly Plan, Files, Nav, Test with four sensible "why" lines — full marks.
  2. Swapped Nav and Files? The classic instinct — "write the nav while it's fresh" — but a nav pointing at ghost files can't be click-tested. Re-read step 2's why.
  3. Put Test anywhere but last? Ask yourself what a click-test can verify when nothing is linked yet.

Part 11 · Inside one page

Jump links — id + #fragment, at real scale.

Links can also jump within a page. Give any element an id — a unique name — and an anchor whose href is #that-name scrolls straight to it. On a three-line page that's a party trick. On the full ten-dish Poshtik Campus menu, it's the difference between finding a dish in one click and scrolling past nine you didn't want.

Step 1 — name the landing spot

<h2 id="ragi-idli-bowl">Ragi Idli Bowl</h2> — the id is invisible to visitors. Rules: unique on the page, no spaces, and by our house style: lowercase kebab-case, same as filenames.

Step 2 — link to it with #

<a href="#ragi-idli-bowl">Ragi Idli Bowl</a> — the # marks a fragment: "this page, that section". Clicking scrolls; no new file loads. The two names must match exactly.

menu-full/menu-full.htmlBUILDS ONE LINE PER PRESS
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Poshtik Campus · Full Menu</title>
6 </head>
7 <body>
8 <h1>Poshtik Campus · Full Menu</h1>
9 <!-- jump list: one fragment link per dish -->
10 <ul>
11 <li><a href="#jonna-rotte-wrap">Jonna Rotte Wrap</a></li>
12 <li><a href="#sajja-roti-wrap">Sajja Roti Wrap</a></li>
13 <!-- …same pattern for the other 8 dishes… -->
14 <li><a href="#millet-protein-shake">Millet Protein Shake</a></li>
15 </ul>
16 <!-- dish sections: each id matches one link above -->
17 <h2 id="jonna-rotte-wrap">Jonna Rotte Wrap</h2>
18 <img src="assets/jonna-rotte-wrap.png" alt="Jonna Rotte Wrap on a banana leaf">
19 <p>High in fibre · rich in iron · gluten free.</p>
20 <p><a href="#top">Back to top</a></p>
21 <h2 id="sajja-roti-wrap">Sajja Roti Wrap</h2>
22 <!-- …sections for all 10 dishes continue the same way… -->
23 </body>
24</html>
Poshtik Campus · Full Menu
file:///C:/Users/student/Desktop/fswd-practice/class-04/menu-full/menu-full.html#jonna-rotte-wrap
Poshtik Campus · Full Menu
Jonna Rotte Wrap dish card
1 · Jonna Rotte Wrap

High in fibre · rich in iron · gluten free.

Back to top
Sajja Roti Wrap dish card
2 · Sajja Roti Wrap

Wholesome · traditional · nutritious.

Back to top
Ragi Sangati Bowl dish card
3 · Ragi Sangati Bowl

High in calcium & fibre · rich in iron · gluten free.

Back to top
Ragi Idli Bowl dish card
4 · Ragi Idli Bowl

Wholesome · traditional · nutritious.

Back to top
Pesarattu with Sprouts dish card
5 · Pesarattu with Sprouts

High in protein · boosts energy.

Back to top
Ulava Charu Protein Bowl dish card
6 · Ulava Charu Protein Bowl

High in protein & fibre · rich in iron.

Back to top
Gongura Sprouts Salad dish card
7 · Gongura Sprouts Salad

Traditional taste · modern nutrition.

Back to top
Sprouts Moong Chilla dish card
8 · Sprouts Moong Chilla

Light · wholesome · protein packed.

Back to top
Paneer Protein Bowl dish card
9 · Paneer Protein Bowl

Balanced · nutritious · delicious.

Back to top
Millet Protein Shake dish card
10 · Millet Protein Shake

Wholesome · nutritious · refreshing.

Back to top
Ten dishes, ten ids, ten one-click jumps — scroll this preview and feel how long the page really is. That length is the whole argument for fragment links. And these jumps are real: click any dish name above and the preview scrolls straight to it; every Back to top really returns.
SAVE THIS AS
FOLDERC:\Users\student\Desktop\fswd-practice\class-04\menu-full\ — its own folder: a realistic-scale demo with its own asset set
FILENAMEmenu-full.html — write all 10 dish sections yourself; the two comment lines in the panel mark where the pattern simply repeats
PHOTOSUnzip the asset pack (downloaded on page 1) into menu-full\assets\ — every src="assets/…" then resolves. All ten dish cards are in the pack — the Ragi Sangati Bowl photo included, so no placeholder tags remain.
GIT?No — even this realistic-scale build is sandbox practice. The day this pattern lands inside poshtik-campus\, it gets committed with a message worth reading.
Fragments join the family — and combine with it.

You now know every href kind: relative (menu.html), absolute (https://…), email (mailto:) and fragment (#ragi-idli-bowl). They compose: menu-full.html#paneer-protein-bowl from another page jumps straight to that dish — file first, fragment after.

GO DEEPER · YOU USE FRAGMENTS DAILY

Wikipedia's "Contents" box is a fragment-link list. A shared YouTube timestamp, a docs page's "§ heading" link, this course's own section rail on the left of this page — all fragments. Watch your address bar after any in-page jump: everything from # onward is the fragment, and the browser never re-downloads the page to honour it.

One convention worth copying: href="#top" works because browsers treat #top as "scroll to the very top" even without an element named top — a freebie the "Back to top" links above rely on.

YOUR TURN · X-RAY THE PAGE

DevTools challenge: find the <a> behind "See the menu".

Every browser ships a professional X-ray machine for web pages, free. Today it answers one sharp question about your own mini-site: exactly which anchor tag fires when you click "See the menu"?

Step 1. Open your own mini-site\index.html in Chrome.

Step 2. Right-click directly on the "See the menu" link text — not empty space beside it — and choose Inspect from the menu that appears.

Step 3. A panel opens: the Elements tab, showing your page as the browser understands it. One line is already highlighted — the exact element you right-clicked.

Your three answers:

  • Copy the full highlighted <a> line, character for character.
  • Which attribute holds the destination, and what is its value?
  • Hover that highlighted line — what lights up in the page above, and what does that tell you about the panel?

Actually do the right-click first — the panel is the lesson.

WORKED SOLUTION · DEVTOOLS

What the Elements panel showed you.

ElementsConsoleSourcesNetwork
<body>
<h1>Poshtik Campus</h1>
<p>Healthy food, healthy body, healthy mind — …</p>
<p>
<a href="menu.html">See the menu</a><- ① the answer, highlighted
</p>
<p><a href="about.html">About us</a></p>
</body>
The three answers, precisely.

<a href="menu.html">See the menu</a> — exactly what you typed in Part 5, proof the browser kept your markup as-is. ② The href attribute holds the destination; its value is menu.html, a relative path. ③ Hovering the line makes the browser highlight the real link in the page above — the panel and the page are two views of the same live structure, not a copy. Change one, the other follows.

Score yourself honestly
  1. Got all three, including ③'s "two views of one structure" insight — full marks. Inspect is now permanently on your toolbelt.
  2. Found the tag but couldn't name the attribute — revisit Part 3's anatomy; the four parts of <a> should be automatic by Lab 1.
  3. Panel didn't open? F12 or Ctrl+Shift+I opens it directly — then click the arrow-in-square icon at its top-left and click the link in the page.

GO DEEPER · READ ANY SITE'S LINKS

Inspect works on every website, not just yours. Open any shopping site, inspect its nav bar, and read the hrefs: you'll recognise relative paths, absolute URLs and fragments — the exact vocabulary you learned today, powering pages built by thousand-person teams. Nothing on the web is hidden from Inspect: it is how working developers learn from other people's pages every day.

YOUR TURN · THE OUT-OF-CONTEXT TEST

Does every link make sense on its own?

Many blind and low-vision users browse with a screen reader — software that reads pages aloud. One of its most-used features reads out only the links, as a bare list, skipping everything around them. Your link text has to survive with all its surrounding context stripped away.

The audit: below are the links from a careless version of a mini-site's home page, exactly as a screen reader's link list would announce them. For each: does it make sense out of context — PASS or FAIL? For every FAIL, write the link text you'd use instead.

1 · "click here"

The paragraph around it said "To see our dishes, click here" — but the screen reader's link list carries only these two words.

2 · "See today's menu"

Announced with nothing before or after it.

3 · "here"

From the sentence "Our story is here". One word, alone in the list.

4 · "About Poshtik Campus"

Announced with nothing around it.

5 · "read more" · "read more" · "read more"

Three identical links, one per dish paragraph — the link list announces all three back-to-back-to-back.

Rule of thumb before you peek: read each link aloud with your eyes closed to the rest of the page.

WORKED SOLUTION · LINK-TEXT AUDIT

Two pass. Three fail. Here's why.

1 · "click here" — FAIL

Where? To do what? The destination lived in the words around the link, and the link list strips them. Rewrite: <a href="menu.html">See today's menu</a> — move the meaning into the link text.

2 · "See today's menu" — PASS

Names its destination all by itself. Anyone hearing only these four words knows exactly what pressing Enter does.

3 · "here" — FAIL

The worst offender: one word, zero information. Rewrite: <a href="about.html">Read our story</a>.

4 · "About Poshtik Campus" — PASS

Self-describing. Notice the pattern in both passes: the link text could serve as the title of the destination page.

5 · "read more" ×3 — FAIL

Each might survive alone, but three identical links to three different places make the list useless — "read more, read more, read more". Rewrite each with its dish: More about the Jonna Rotte Wrap, More about the Ragi Idli Bowl, More about the Millet Protein Shake.

One habit, three wins.

Descriptive link text helps screen-reader users first — and then everyone else: search engines rank pages partly by the words inside links pointing at them, and sighted visitors scanning a page read link text the same out-of-context way. Write every link so it stands alone, from your very first site. Retrofitting this later across hundreds of links is miserable; doing it from day one is free.

Score yourself honestly
  1. All five verdicts right with sensible rewrites — full marks; your links are already better than half the live web's.
  2. Called #5 a PASS? Understandable — each link alone reads fine. The failure only appears when you hear the list. That's why the audit simulates the list, not one link at a time.
  3. Rule to keep: if the link text could be the destination page's title, it passes.

Part 16 · Wrap-up

You own a website. Lab 1 is unlocked.

Every skill on today's agenda landed. Say each of these out loud — any hesitation marks your revision list.

I can read and write a complete <a href> tag and name all four of its parts.
I choose relative paths for my own pages and absolute URLs for other sites — and I can explain why the reverse breaks.
I built and click-tested a real three-page site with two-way navigation.
I can open a new tab safely with target="_blank" rel="noopener" and write a mailto: link.
I can jump anywhere inside a long page with id + #fragment — and knew Plan–Files–Nav–Test without looking.
I can inspect any link on any site, and my own link text passes the out-of-context test.

Your sandbox after today

FSWD-PRACTICE — CUMULATIVE TREE
fswd-practice\
├─ class-02\ previous · unchanged
│   └─ hello.html
├─ class-03\ previous · unchanged
│   ├─ skeleton.html · headings.html · … (7 files)
│   └─ assets\ragi-sangati.jpg
└─ class-04\ new this class
    ├─ anchor-demo.html
    ├─ outside-links.html
    ├─ mini-site\
    │   ├─ index.html · menu.html · about.html
    │   └─ assets\
    ├─ menu-full\
    │   ├─ menu-full.html
    │   └─ assets\ (10 dish photos)
    └─ activities\
        └─ nav-practice.html
TODAY'S POINTWHAT IT LEFT ON YOUR DISK
3 · Anchor anatomyclass-04\anchor-demo.html
4 · Pathsconcept only · no file
5 · The mini-sitemini-site\index.html + menu.html + about.html
6 · External & email linksclass-04\outside-links.html
7–8 · Campus Nav activityactivities\nav-practice.html
11 · Fragments at scalemenu-full\menu-full.html + its assets\
12–15 · DevTools + auditskills only · no new files
These files stay put.

Nothing in fswd-practice\ is ever deleted or "handed in" — it is your permanent study record. Lab 1 opens a separate, brand-new poshtik-campus\ folder for the real project; the sandbox continues untouched alongside it.

Before Lab 1

REBUILD IT BLIND

Delete nothing — but in a scratch folder, rebuild the three-page mini-site from memory: files, skeletons, two-way links. Under 15 minutes means you're Lab-1 ready.

FINISH THE FULL MENU

Complete all ten id-tagged sections of menu-full.html with the pack's photos in assets\. Click all ten jump links and all ten "Back to top"s.

INSPECT THREE REAL SITES

On any three sites you use daily, inspect one nav link each. Classify every href you find: relative, absolute, or fragment. Bring one interesting find to Lab 1.

EXIT TICKET · 30 SECONDS, ON PAPER

Your about.html needs a link that jumps straight to the Paneer Protein Bowl section of menu-full.html, which lives in the sibling folder menu-full\. Write the full anchor tag. (Hint: you'll need Part 4's "up one level" dots, a filename, and a fragment — all three in one href.)