Cohost.org opened to the public in June 2022 with invite-only registration. Its landing page, in peach and maroon, promised "posting, but better." In September 2024, citing burnout and funding problems, the site announced its shutdown, and today every link to cohost.org redirects to the Wayback Machine archive of the site.

Screenshot of the Cohost.org homepage before it was shut down.

The platform was defined by an opinionated, anti-capitalist design that set it apart from mainstream alternatives. There were no advertisements, no follower counts, and every feed was purely chronological. Cohost's posting interface also accepted a subset of HTML, and that feature gave rise to a community of its own.

Posts containing HTML were passed through a sanitizer to strip out malicious or malformed markup, but Cohost's sanitizer was unusually permissive. Nearly every tag and attribute was allowed — above all, inline CSS on arbitrary elements. Within 48 hours of going public, the community had posted poetry using the <details> tag, ported the Apple homepage from 1999, and reimplemented a quick-time WarioWare game. Such posts became known as "CSS Crimes," and their authors as "CSS Criminals." Users mostly drawn from niche internet creative circles, many of whom already treated posting as an art form, had grasped the opportunities in the unassuming "new post" modal.

Encoding state through width

The checkbox hack lets a checkbox, label and CSS selectors build tabbed areas, toggles and dropdowns. On Cohost that was impossible, because only inline styles were available, never selectors. The <details> and <summary> elements supply the same toggling logic directly in HTML.

Inside a <details>, every child is hidden by default except the <summary>; clicking the summary opens the parent and makes the other children visible. Styled with a fixed size, a grey background and an outset border, a summary reads as a button. A sibling <div> revealed on click can cover it with a red background and border, and giving that div pointer-events: none lets clicks pass through to the summary beneath, so the button can be turned back off. The result is still a two-state toggle, far short of the hundreds or thousands of states that games need.

Width-hacking, as user @corncycle named it, closes that gap. Three <details> elements sit in an inline-flex container; their summaries are absolutely positioned, so each <details> has zero width while closed. Each one holds a small <div> — widths of 1px, 2px and 4px respectively — so opening a <details> adds that child's width to the container. The container's width therefore encodes which elements are open: the first and third open gives 1px + 4px = 5px, and a width of 2px means only the second is open. All eight combinations are represented.

To reveal a secret message only when the right combination is set, the message is wrapped in two nested divs. The parent div.secret is reduced to zero width, and overflow: hidden clips the child div.message so it stays invisible. Percentage sizes are relative to the parent, so 100% can stand in for the parent's width inside a calc() formula that is 350px at the target width and 0px otherwise. The formula is a piecewise linear curve assembled from min/max pieces, tuned to max out when the container is 2px — that is, when only the second button is active.

Line chart showing the width of the secret div when the container div is at different widths.

A surprising variety of games follows from variations on this idea. A tower of Hanoi game tracked its state in both width and height.

Animation inside SVG backgrounds

SVG applies outside as well as inside HTML and can serve as the source of a background-image. SVG documents and HTML documents are alike: both are collections of elements — <rect>, <circle>, <text> — with properties like fill color, stroke width and font family. Less widely known is that an SVG can carry <style> blocks, so a <style> inside an SVG used as a div background can set that div's <circle> fill to red.

Lesser known still: styles inside an SVG can use media queries, and the size queried is that of the div the SVG is a background of. A resizable div whose SVG background holds a media query turning its <circle> fill to blue once the width passes 100px is a complete demonstration. Resize handles don't work well on mobile, so these examples are best tried on desktop.

Combined with width-hacking, this becomes powerful. The state of a game or gizmo can be encoded in the width of an SVG background, and media queries within the SVG can show or hide elements according to that state.

Animations follow from the same foundation: CSS animations work inside SVGs, and the transition property can make the circle's fill pass smoothly from red to blue. The source needs a workaround, though — a 1×1px off-screen element with the ID #hack, carrying a simple, nearly unnoticeable continuous animation. Browsers detect SVG animation unreliably without such a dummy animation, and transition would not work consistently.

Merging this with the secret message changes the setup. The div is normally 350px wide and becomes 351px when the correct combination is set; the message is an SVG background containing a <text> element that reads "secret message." Media queries set the transform scale of that <text> to zero unless the div is 351px, and transition smooths the change between the two states.

@ticky was the first Cohost user to discover media queries in SVG backgrounds, in this post. The origin of their use for animation is unclear, but the technique appeared extensively in a quiz that tells you what kind of soil you'd like if you were a worm.

Further reading

Techniques remain unexplored, notably the antics the resize property allows. YellowAfterlife's linkdump and rebane2001's video retrospective cover more of the territory.

Describing Cohost in the past tense is painful; it was a magical place. The hacks the community came up with — the lost CSS tricks invented while "posting, but better" — are what remains of it.