1. HTML (HyperText Markup Language)
- Purpose: Structures web content (text, images, links, etc.).
-
Role: Defines elements like headings (
), paragraphs (
), forms (
), etc.
- Example:
Hello World
This is a paragraph.
2. CSS (Cascading Style Sheets)
- Purpose: Styles and layouts HTML elements (colors, fonts, spacing).
- Role: Controls visual presentation using selectors and properties.
- Example:
h1 { color: blue; }
p { font-size: 16px; }
3. JavaScript (JS)
- Purpose: Adds interactivity and dynamic behavior.
- Role: Manipulates DOM, handles events, fetches data, etc.
- Example:
document.querySelector("h1").addEventListener("click", () => {
alert("Heading clicked!");
});
How They Work Together
- HTML = Skeleton (structure).
- CSS = Skin (appearance).
- JavaScript = Brain (functionality).
These three form the foundation of front-end web development. 🚀