HTML and CSS Reference
progressive enhancement has been such a successful development model. It allows a point of
reference to guide us and to serve as a reminder as we develop a project, so we don't “ cross
yourself before injecting style information into a document. Of course, the case for not injecting
cases where you might need to apply styles progressively, for example, in a drag and drop
interface where positioning information needs to be constantly updated based on cursor (or
But generally speaking, you can safely house all the style information you need within
CSS and reference styles as reusable classes. This is a much more flexible model than
adding style information into your HTML. We follow this model when it's only HTML and CSS,
certainly something we need to keep an eye on.
A lot of front-end developers take real pride in having clean HTML. It's easy to work with, and
to certain super-geeks it can even be artful. It's great to have clean, static HTML, but what
good is that if your generated HTML is riddled with injected style and non-semantic markup?
By “generated HTML,” I'm referencing how the HTML looks after it's been consumed and
having clean HTML and separated progressive enhancement layers is to not use a style
attribute for you.
CLEANING UP YOUR HTML
We can probably all agree that blindly using a technology is a terrible idea, and I think we're at
a point with jQuery where we are, indeed, blindly using a lot of the features without fully
understanding what's going on under the hood. The example I lean on pretty heavily for
principles of progressive enhancement, you wouldn't code something with inline CSS like this: