John Cox

Blogs · @wyome

Tagged development · everything

The CSS white-space Property Explained | Impressive Webs

The CSS white-space property controls how browsers handle multiple spaces and line breaks within an element, offering cleaner alternatives to HTML methods like the `<pre>` tag or `&nbsp;`. The property has five values—normal (default), nowrap (prevents line breaks), pre (preserves all spacing like `<pre>` tags), pre-line (honors explicit line breaks only), and pre-wrap (preserves spacing while allowing natural wrapping)—with nowrap being the most practical for keeping inline content like links together without splitting across lines. A common misconception is that white-space applies to block-level elements or floated boxes themselves; it only affects inline content within the targeted element.

Permalink

Bulletproof HTML5 <details> fallback using jQuery · Mathias Bynens

The HTML5 `<details>` and `<summary>` elements create collapsible disclosure widgets that hide content by default, but browser support was incomplete at the time of writing. The author provides a robust feature detection method to identify native support and explains how to implement a cross-browser polyfill using CSS and jQuery that adds click and keyboard accessibility while gracefully degrading in older browsers and when JavaScript is disabled.

Permalink

.htaccess Files for the Rest of Us | Nettuts+

.htaccess files are plain text configuration files used to customize Apache web server behavior at the directory level, and this guide covers their practical applications including URL rewriting and redirects for SEO purposes, custom error pages, password protection, IP blocking, browser rendering control, caching optimization, and content compression. The article explains that .htaccess files are read on every server request so changes take immediate effect without server restart, making them useful when direct access to the main configuration file isn't available, though they do incur a minor performance cost. Each use case is illustrated with code examples showing how to implement common tasks like converting query strings into friendly URLs, serving custom 404 pages, and setting far-future expiration headers to improve site load times.

Permalink

HTML5 Please - Use the new and shiny responsibly

I can see this is a list of article titles and metadata from The HTML5 Please website, but there are no article summaries provided for me to rewrite. The content shows only headlines, publication dates, and author attribution—not the actual article text or arguments. To help you, I would need the full text or existing summaries of specific articles you'd like me to condense. Could you provide the article content you'd like summarized?

Permalink

Backbone patterns

This guide documents best practices for building Backbone.js applications, covering patterns for models, views, and general architecture alongside conventions for naming, namespacing, and module organization. It identifies common anti-patterns to avoid, such as overusing document.ready and placing event handlers outside of views, while recommending approaches like using JST templates, sub-views, and mixins for cleaner code structure.

Permalink