web/

Browsers, HTML and CSS, HTTP, frameworks and APIs.

13 results
web/stacking-contexts-why-z-index-9999-can-still-lose-to-z-index-2.md Stacking contexts: why z-index: 9999 can still lose to z-index: 2 You give a dropdown z-index: 9999 and it still hides behind a box that only says 2. The number is not too small: browsers sort layers in… 6 min read · 4 Nov web/viewport-and-media-queries-why-a-page-looks-tiny-on-a-phone-and-how-it.md Viewport and media queries: why a page looks tiny on a phone, and how it rearranges itself Why does a page look like a tiny copy of the desktop version on a phone, and how does the same page rearrange itself for a small screen?… 4 min read · 1 Nov web/cors-why-a-browser-blocks-a-request-your-server-happily-answered.md CORS: why a browser blocks a request your server happily answered You call your own API from a web page and the browser says blocked by CORS policy, even though the address works in a new tab. The server… 5 min read · 29 Oct web/flexbox-how-a-row-of-boxes-decides-who-gets-the-leftover-space.md Flexbox: how a row of boxes decides who gets the leftover space Put three boxes in a row and the browser decides, by a short fixed recipe, who gets the extra room and who gives some up. Learn the three… 6 min read · 26 Oct web/css-specificity-why-your-style-is-ignored.md CSS specificity: why your style is ignored You write a style, reload the page, and the text is still the old colour. Nothing is broken: another rule is winning, and CSS decides with… 7 min read · 22 Oct web/the-dom-how-a-browser-turns-html-text-into-a-tree.md The DOM: how a browser turns HTML text into a tree A web page starts as plain text, yet a script can add a bullet to it while it is open. How? The browser never works on your text directly… 6 min read · 19 Oct web/cookies-how-a-website-remembers-you-between-requests.md Cookies: how a website remembers you between requests The web forgets you after every request, so how does a site know you are still logged in? With a cookie: a small name and value the server… 4 min read · 16 Oct web/event-bubbling-why-clicking-a-button-also-clicks-its-parent.md Event bubbling: why clicking a button also clicks its parent You click a button inside a div, and both click handlers run. Why does the parent hear about something that happened to its child? Every… 5 min read · 13 Oct web/http-requests-and-responses-what-a-404-and-a-301-really-say.md HTTP requests and responses: what a 404 and a 301 really say Every web page starts as two short pieces of plain text: a request from your browser and a response from a server. Learn to read them and… 4 min read · 10 Oct web/why-is-my-css-ignored-specificity-scored-with-three-numbers.md Why is my CSS ignored? Specificity, scored with three numbers You write `p { color: red; }`, reload, and the text stays blue. The rule is fine: two rules are competing, and yours lost the contest. The… 4 min read · 7 Oct web/what-is-json-edit-it-live-and-see-why-apis-are-so-strict-about-it.md What is JSON? Edit it live and see why APIs are so strict about it When an app asks a server for data, the reply has to travel as plain text. JSON is the format most web APIs use: six kinds of value… 5 min read · 4 Oct web/html-tags-how-angle-brackets-become-a-tree-in-your-browser.md HTML tags: how angle brackets become a tree in your browser Every web page is plain text with labels in angle brackets: HTML tags. An opening tag, some content and a closing tag make an element, and… 13 min read · 1 Oct