Web Designing Cheat Sheet: HTML, CSS, Flexbox, Grid, JavaScript, Accessibility and Git Quick Reference
HTML Starter
html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page title</title>
<meta name="description" content="Short summary">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header></header>
<main></main>
<footer></footer>
<script src="js/main.js" defer></script>
</body>
</html>
Semantic Tags
| Tag | Use |
|---|---|
header | Intro or top area |
nav | Main navigation links |
main | Primary content |
section | Themed group with a heading |
article | Self contained item |
aside | Side information |
footer | Closing information |
CSS Essentials
css
*, *::before, *::after { box-sizing: border-box; }
:root { --brand: #0b5fff; --space: 1rem; }
.btn { background: var(--brand); padding: var(--space); }
.btn:hover, .btn:focus-visible { filter: brightness(0.9); }
img { max-width: 100%; height: auto; }
Flexbox and Grid
css
.row { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
@media (min-width: 700px) { .menu { display: flex; } }
JavaScript DOM
javascript
const btn = document.querySelector(".menu-btn");
btn.addEventListener("click", () => {
const open = btn.getAttribute("aria-expanded") === "true";
btn.setAttribute("aria-expanded", String(!open));
});
Accessibility Checklist
langset onhtml- One
h1and logical headings - Alt text on meaningful images
- Labels on every form field
- Contrast 4.5 to 1 for normal text
- Everything works with the keyboard
- Visible focus style
Git Commands
| Command | Purpose |
|---|---|
git init | Start a repository |
git status | See changes |
git add . | Stage all changes |
git commit -m "message" | Save a snapshot |
git push | Send commits to GitHub |
git pull | Get remote changes |
Conclusion
Keep this page open while you build. Check MDN for any detail you forget.
Quick Summary: HTML starter; semantic tags; CSS; Flexbox and Grid; DOM; accessibility; Git.

