Apa Itu HTML dan CSS?
HTML (HyperText Markup Language) adalah bahasa markup untuk membuat struktur halaman web. CSS (Cascading Style Sheets) adalah bahasa styling untuk membuat halaman web terlihat menarik. Keduanya adalah fondasi dari web development — setiap website di dunia dibangun dengan HTML dan CSS.
Mengapa HTML & CSS Wajib Dipelajari?
- Fondasi Web — Semua website dibangun dengan HTML & CSS
- Mudah Dipelajari — Sintaks sederhana dan intuitif
- Visual — Hasil langsung terlihat di browser
- Wajib untuk Web Dev — Prerequisite untuk JavaScript, React, Vue
- Freelance Opportunity — Banyak job landing page dan website sederhana
- SEO — Struktur HTML yang baik penting untuk SEO
Roadmap Belajar HTML & CSS
Level 1: Beginner (Dasar HTML & CSS)
HTML:
- Struktur Dasar — <!DOCTYPE html>, <html>, <head>, <body>
- Text Elements — h1-h6, p, span, strong, em, br, hr
- Links & Images — <a>, <img>, <picture>
- Lists — <ul>, <ol>, <li>, <dl>
- Tables — <table>, <tr>, <th>, <td>
- Forms — <form>, <input>, <textarea>, <select>, <button>
- Semantic HTML — <header>, <nav>, <main>, <article>, <section>, <footer>
- Media — <video>, <audio>, <iframe>
CSS:
- Selectors — Element, class, id, attribute, pseudo-class, pseudo-element
- Colors & Typography — color, font-family, font-size, font-weight, line-height
- Box Model — margin, padding, border, width, height, box-sizing
- Display — block, inline, inline-block, none, flex, grid
- Position — static, relative, absolute, fixed, sticky
- Background — background-color, background-image, gradient
Level 2: Intermediate
- Flexbox — display: flex, justify-content, align-items, flex-wrap, gap
- CSS Grid — grid-template-columns, grid-template-rows, grid-area
- Responsive Design — Media queries, mobile-first, viewport
- CSS Variables — –variable, var()
- Transitions & Animations — transition, @keyframes, animation
- Transforms — translate, rotate, scale, skew
- Pseudo-classes — :hover, :focus, :nth-child, :not()
- Forms Styling — Custom checkboxes, radio buttons, inputs
Level 3: Advanced
- CSS Architecture — BEM, OOCSS, SMACSS, utility-first (Tailwind)
- CSS Preprocessors — SASS/SCSS, LESS, Stylus
- CSS-in-JS — Styled Components, Emotion
- Advanced Selectors — :has(), :is(), :where(), :nth-of-type()
- Container Queries — @container
- Subgrid — grid-template-columns: subgrid
- View Transitions API — Smooth page transitions
- Accessibility — ARIA roles, focus management, screen reader
Level 4: Expert
- Performance — Critical CSS, lazy loading, font optimization
- CSS Houdini — Custom properties, paint API
- Design Systems — Component library, design tokens
- Cross-Browser — Vendor prefixes, polyfills, progressive enhancement
- SEO Optimization — Semantic HTML, meta tags, structured data
Contoh Kode HTML & CSS
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Belajar HTML & CSS</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(135deg, #667eea, #764ba2);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.card {
background: white;
border-radius: 16px;
padding: 2rem;
box-shadow: 0 20px 60px rgba(0,0,0,0.2);
max-width: 400px;
width: 100%;
transition: transform 0.3s ease;
}
.card:hover {
transform: translateY(-8px);
}
.card h1 {
color: #333;
margin-bottom: 0.5rem;
}
.card p {
color: #666;
line-height: 1.6;
margin-bottom: 1rem;
}
.btn {
display: inline-block;
background: #667eea;
color: white;
padding: 0.75rem 1.5rem;
border-radius: 8px;
text-decoration: none;
font-weight: 600;
transition: background 0.3s;
}
.btn:hover {
background: #5a67d8;
}
@media (max-width: 480px) {
.card {
margin: 1rem;
padding: 1.5rem;
}
}
</style>
</head>
<body>
<div class="card">
<h1>Hello World!</h1>
<p>Ini adalah contoh card dengan HTML dan CSS. Hover untuk melihat efek.</p>
<a href="#" class="btn">Klik Saya</a>
</div>
</body>
</html>
Tips Belajar HTML & CSS
- Praktik langsung — Buat halaman web sederhana setiap hari
- Gunakan DevTools — Inspect element untuk belajar dari website lain
- Mobile-first — Desain untuk mobile dulu, lalu desktop
- Pelajari Flexbox & Grid — Ini kunci layout modern
- Gunakan Tailwind CSS — Utility-first CSS framework yang populer
- Validasi HTML — validator.w3.org
- Ikuti tutorial interaktif — freeCodeCamp, Codecademy, MDN
Tools yang Dibutuhkan
| Tool | Deskripsi |
|---|---|
| Browser (Chrome/Firefox) | Menjalankan & inspect HTML/CSS |
| VS Code | Code editor dengan Live Server extension |
| Figma | Design tool untuk mockup |
| Git | Version control |
| Can I Use | caniuse.com — cek browser support |
Kesimpulan
HTML dan CSS adalah fondasi web development. Dengan menguasai keduanya, Anda bisa membuat website yang menarik dan responsive. Mulai dari dasar, praktik konsisten, dan terus eksplorasi!
“HTML is the skeleton, CSS is the skin, JavaScript is the brain.” — Web Development Community




