HTML: give the page a useful outline.
Use one clear h1 for the page topic, then organise supporting content with headings that do not skip levels. Navigation, main content, and the footer should be easy to identify.
<header>...</header>
<main>
<h1>Project title</h1>
<section aria-labelledby="features">
<h2 id="features">Features</h2>
</section>
</main>
CSS: choose a layout tool intentionally.
Use Flexbox for a one-dimensional row or column. Use Grid when you need control over both rows and columns. Keep spacing values consistent rather than adding one-off margins everywhere.
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem;
}
JavaScript: update text safely.
When you only need to show text from code, use textContent. It prevents a value from being interpreted as HTML.
const status = document.querySelector('[role="status"]');
status.textContent = 'Saved successfully.';