Correct run-in headings

I’ve recently noticed a couple of blogs that use an awkward “span” kludge to create “run-in” headings. These are both by smart guys who should know better. Instead of using structurally correct headings and paragraphs, the heading text is part of the paragraph, and is just bracketed with SPAN tags so that it can be styled differently.

CSS-2 does include a “run-in” display style that achieves exactly what these guys want, but it is not universally supported. There are a couple of possible workarounds, both of which I’ve documented. One is to float the header; the other is to style the header and the paragraph immediately following as “inline.”

4 thoughts on “Correct run-in headings”

  1. There you go again, elevating the coding caliber of Blogistan and the Internet as a whole …

    I’ll remember this because there are times when I want to do a run-in header! Thanks.

  2. Actually, I’d rather have MT *not* generate the P tags around the blog entry so I wouldn’t need any ‘inline’ spec. It was a surprise that it was automatically generated, so I slapped in a quick fix. I’m having a personal philosophical crisis with titles, having never had to use them before. As with my older design, I don’t necessarily need or want to differentiate the title from the body of the post. Or even designate a title! So the inline problem turns out to be the symptom of a wider malady, really. Not sure what I’m going to do about them.

    This hacked default MT CSS is pretty awful at present, as I’ve admitted publicly. I prefer much more, ‘economic’ CSS [as simple as possible, no multiple font declarations, for example]. I’ll be restyling it soon, to restore right-side navigation. For that restyle, I’ll take your suggestion, Adam, with gratitude.

  3. James–I suppose if you really wanted to roll up your sleeves, you’d use the various CSS-hiding hacks and present the “run-in” style to those browsers that can handle it, and one of the alternatives to those that can’t. Float seems to render more reliably in my simple demo, but in a more elaborate page with other floats (such as my blog page), it could get hairy. I think it’s a judgment call.

    Garret–I sympathize. I came to MT from Blogger, where I had no titles–I just wrote. I disliked titles at first too. But I’ve changed my mind. Titles are important metadata. They’re required for RSS feeds. They give you a handle for recent posts in the sidebar, if you’re into that sort of thing. From the site-maintenance perspective, it’s good to have a list of meaningful titles in your “manage weblog” view. And there may be an accessibility angle. That said, you still might not want to show the titles in the main content of your blog. In which case, exclude them from the template, or style them “visibility: hidden”.

Comments are closed.