Posts

Showing posts with the label web development

Writing CSS Layouts With LLMs in October 2026: Paste Your Real Markup, Prefer Grid and Flexbox, and Check It in a Real Browser

Image
Ask a chat model for "a responsive card grid" and you will get CSS back in seconds. Sometimes it is clean and modern. Sometimes it is a pile of floats, fixed pixel widths, magic negative margins, and a media query for a breakpoint your site does not use. The model is not the problem so much as the prompt: CSS depends heavily on context the model cannot see, like your existing markup, your design tokens, and which browsers you support. This guide covers a practical workflow for getting layout CSS out of an LLM that you can actually ship: give it the right inputs, steer it toward Grid and Flexbox, and verify the result in a real browser instead of trusting how the code looks. Why LLM-written CSS goes wrong Most broken layout code from a model falls into a few patterns: It invents markup. If you do not paste your HTML, the model writes selectors for class names it made up, and then the CSS silently matches nothing. It mixes eras. Training data spans decades of CS...

Writing Accessible HTML Forms With LLMs in October 2026: Label Every Field, Announce Errors in Words, and Test With a Keyboard and Screen Reader

Image
Ask a language model for a signup form and you will get one in seconds. It will usually look fine. The trouble shows up later, when someone tabs through it with a keyboard, uses a screen reader, or zooms to 200% on a phone. Generated forms tend to repeat the same handful of accessibility mistakes, and those mistakes are invisible in a quick visual check. The good news is that the fixes are well understood and mostly mechanical. This guide covers how to prompt for accessible form markup, what to check in every draft, and how to test the result before it ships. A basic web form with text fields, checkboxes, and radio buttons. Image: Cburnett, CC BY-SA 3.0 , via Wikimedia Commons . Why generated forms go wrong Models learn from a huge amount of real-world HTML, and a lot of real-world HTML is inaccessible. The most common patterns they reproduce are: Placeholder text used as the label. The hint disappears as soon as the user starts typing, and many screen readers treat it i...

Rendering LLM Output Safely in Web Apps in October 2026: Sanitize Markdown, Block Image-URL Data Exfiltration, and Keep Links Honest

Image
Most chat interfaces take the model's reply, run it through a Markdown renderer, and drop the result into the page. It looks harmless because the text came from "your" model. But the model's output is shaped by everything that went into its context: user messages, retrieved documents, web pages, tool results, and emails. If any of that content is hostile, the reply can carry HTML, scripts, tracking images, or misleading links straight into your users' browsers. This guide treats model output the way you would treat any user-generated content. It covers how to render Markdown without executing HTML, why images are the most common quiet leak, how to keep links honest, and how to do all of this while streaming tokens without breaking the UI. Photo: Html php java source code by Markus Spiske, CC0 , via Wikimedia Commons Why model output is untrusted input A model does not have to be "jailbroken" to emit something dangerous. Three ordinary situations...