Resources / Coding
Free to readCoding⏱ 4 min read

Web development basics — HTML, CSS and JavaScript

Build your first web page from scratch: structure with HTML, style with CSS and make it interactive with JavaScript.

The three languages of the web

LanguageJobThink of it as
HTMLthe content and structurethe skeleton
CSScolours, fonts, layoutthe clothes
JavaScriptactions and logicthe muscles

All you need is a text editor (VS Code is free) and a browser. Save a file as index.html and double-click it.

1. Your first HTML page

📖 HTML

Definition: HTML (HyperText Markup Language) is the standard markup language that defines the structure and content of web pages using elements written as tags.

How it works: The browser parses HTML into the DOM (Document Object Model), a tree of elements. Semantic tags (header, nav, main, article, footer) describe meaning, which helps accessibility and SEO.

Example: <h1> marks the main heading, <a href> a link, <img> an image.

🧒 In simple words

HTML
<!doctype html>
<html>
  <head>
    <title>My first page</title>
  </head>
  <body>
    <h1>Hi, I'm Asha</h1>
    <p>I am learning web development.</p>
    <a href="https://maniajobs.com">See jobs</a>
  </body>
</html>
▶ Output
The browser shows a big heading "Hi, I'm Asha", a line of text and a link "See jobs".

Tags come in pairs: <p> opens, </p> closes.

Tags you will use every day

TagUse
h1 … h6headings
pparagraph
alink
imgpicture (<img src="me.jpg" alt="My photo">)
ul / libullet list
div / sectioncontainers to group things
form / input / buttonforms

2. Style it with CSS

📖 CSS

Definition: CSS (Cascading Style Sheets) is the language that describes how HTML elements are presented — colours, fonts, spacing and layout.

How it works: Rules have a selector and declarations. When rules conflict, the cascade decides using importance, specificity (id > class > element) and source order. Layout systems: the box model, Flexbox (1-D) and Grid (2-D); media queries make designs responsive.

Example: .card { padding: 16px; border-radius: 12px; } styles every element with class card.

🧒 In simple words

Add this inside <head>:

CSS
<style>
  body { font-family: Arial, sans-serif; max-width: 700px; margin: 40px auto; }
  h1 { color: #4f46e5; }
  .card { padding: 16px; border-radius: 12px; background: #f3f4f6; }
</style>

A selector (h1, .card) picks elements; inside the braces you set properties.

Layout with flexbox

CSS
.row { display: flex; gap: 12px; justify-content: space-between; }

Flexbox puts children side by side. Add flex-wrap: wrap so they stack on phones.

3. Make it interactive with JavaScript

📖 JavaScript

Definition: JavaScript is a high-level, dynamically typed programming language that runs in browsers (and on servers with Node.js) to make web pages interactive.

How it works: It manipulates the DOM, responds to events (clicks, input), and talks to servers with fetch. It is single-threaded with an event loop that handles asynchronous work via callbacks, promises and async/await.

Example: A click on "Add to cart" updates the cart count without reloading the page.

🧒 In simple words

HTML
<button id="btn">Click me</button>
<p id="out"></p>
<script>
  let clicks = 0;
  document.getElementById("btn").addEventListener("click", () => {
    clicks++;
    document.getElementById("out").textContent = "Clicked " + clicks + " times";
  });
</script>
▶ Output
(after 3 clicks)
Clicked 3 times

JavaScript basics

  • let / const make variables.
  • if (x > 5) { … } else { … } decides.
  • for (let i = 0; i < 5; i++) { … } repeats.
  • function add(a, b) { return a + b; } reuses code.
  • document.querySelector(".card") finds an element on the page.

4. Mini project: a to-do list (30 minutes)

  1. HTML: an input, an "Add" button and an empty <ul>.
  2. JS: on click, read the input, create an <li>, add it to the list, clear the input.
  3. Bonus: click an item to mark it done (toggle a CSS class).
  4. Bonus 2: save the list in localStorage so it stays after refresh.

5. Put it online for free

Create a GitHub account → upload your files → turn on GitHub Pages (Settings → Pages). You get a link you can put on your resume.

What to learn next

Responsive design → JavaScript fetch & APIs → a framework (React) → a backend (Node.js or Python) → databases (our SQL tutorial).

Further reading

🔥Join the free 30-Day Placement ChallengeOne resource and one task a day — from resume to offer.