1. HTML (HyperText Markup Language)
- Purpose: Structures web content (text, images, links, etc.).
-
Role: Defines elements like headings (
<h1>
), paragraphs (<p>
), forms (<form>
), etc. - Example:
<h1>Hello World</h1>
<p>This is a paragraph.</p>
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. 🚀
Top comments (0)