← All Articles Β· Β· 3 min read

HTML/CSS/JavaScript Fundamentals: The Core Every Developer Must Know in 2026

The essential HTML, CSS, and JavaScript knowledge that separates senior developers from juniors. Covers semantic HTML, CSS specificity, JavaScript async patterns, and common mistakes.

htmlcssjavascriptfrontendfundamentals

HTML/CSS/JavaScript Fundamentals: The Core Every Developer Must Know in 2026

Semantic HTML Matters

<!-- ❌ Non-semantic -->
<div class="nav">
  <div class="item"><a href="/">Home</a></div>
  <div class="item"><a href="/about">About</a></div>
</div>

<!-- βœ… Semantic -->
<nav>
  <a href="/">Home</a>
  <a href="/about">About</a>
</nav>

Why: Screen readers, search engines, and browsers understand semantic HTML better. It’s also easier to style.

CSS Specificity

When multiple rules target the same element, CSS specificity decides who wins:

SelectorSpecificity Score
*0
p1
.nav10
#sidebar100
style="..."1000
!importantInfinity (avoid)
/* Example specificity battle */
/* Line 1: specificity = 1 */
p { color: blue; }

/* Line 2: specificity = 10 */
.nav p { color: red; }     /* WINS β€” specificity 10 > 1 */

/* Line 3: specificity = 100 */
#sidebar p { color: green; }  /* WINS β€” specificity 100 > 10 */

Rule: Keep specificity low. Avoid !important. Use BEM or CSS Modules to scope styles.

JavaScript Async: Promise vs async/await

// ❌ Callback hell
getUser(userId, (user) => {
  getOrders(user.id, (orders) => {
    getProducts(orders, (products) => {
      render(user, orders, products);
    });
  });
});

// βœ… Promise chain
getUser(userId)
  .then(user => getOrders(user.id))
  .then(orders => getProducts(orders))
  .then(products => render(user, orders, products))
  .catch(error => console.error(error));

// βœ… async/await (recommended)
async function loadData(userId) {
  try {
    const user = await getUser(userId);
    const orders = await getOrders(user.id);
    const products = await getProducts(orders);
    render(user, orders, products);
  } catch (error) {
    console.error(error);
  }
}

The Event Loop

console.log('1');          // runs first (synchronous)

setTimeout(() => console.log('3'), 0);  // added to queue, runs after sync code

Promise.resolve().then(() => console.log('4'));  // added to microtask queue, runs before setTimeout

console.log('2');

// Output: 1 β†’ 2 β†’ 4 β†’ 3

Why: Microtasks (Promises) run before macrotasks (setTimeout). The event loop processes all microtasks before picking up the next macrotask.

DOM Manipulation Performance

// ❌ Causes reflow every iteration
for (let i = 0; i < 1000; i++) {
  document.body.appendChild(document.createElement('div'));
}

// βœ… Batch DOM operations
const fragment = document.createDocumentFragment();
for (let i = 0; i < 1000; i++) {
  fragment.appendChild(document.createElement('div'));
}
document.body.appendChild(fragment);  // Single reflow

The this Keyword

const obj = {
  name: 'Alice',
  greet: function() {
    console.log(`Hello, ${this.name}`);
  },
  greetArrow: () => {
    console.log(`Hello, ${this.name}`);  // `this` is NOT obj!
  }
};

obj.greet();        // "Hello, Alice" β€” `this` is obj
obj.greetArrow();   // "Hello, undefined" β€” arrow captures outer `this`

Local Storage vs Session Storage vs Cookies

FeaturelocalStoragesessionStorageCookies
Capacity5-10 MB5-10 MB4 KB
ExpiryNeverTab closeConfigurable
Sent with HTTP❌ No❌ Noβœ… Yes (automatically)
Accessible from JSβœ… Yesβœ… Yesβœ… Yes
// localStorage
localStorage.setItem('token', 'abc123');
const token = localStorage.getItem('token');
localStorage.removeItem('token');

Free Newsletter

Level Up Your Dev Workflow

Get new tools, guides, and productivity tips delivered to your inbox.

Plus: grab the free Developer Productivity Checklist when you subscribe.

Found this guide useful? Check out our free developer tools.