Replacing class="alignright" etc Was: Re: [wp-hackers] Linking stylesheet to RSS feeds

Lynne Pope lynne.pope at
Fri Jun 19 07:44:21 GMT 2009

2009/6/19 Jeremy Clarke <jer at>

> On Thu, Jun 18, 2009 at 8:01 PM, Lynne Pope<lynne.pope at> wrote:
> > And, for me, this has nothing to do with accessibility and everything to
> do
> > with usability - there are some really badly designed sites out there
> that
> > seem to put design above readability!
> I doubt any of these problems are caused by aligning photos inside
> post text using float: I know the kind of issues you are talking
> about, but they are usually caused by bad text formatting choices. I'd
> NEVER try to impose my text formatting choices on someone reading an
> RSS feed (i hate even doing it with email), but that's a really
> different issue from alignment.

I agree that image alignment in feeds is an issue, but its a slippery slope.
The person who wants to align their images also generally wants to format
captions, apply fonts or colours, and generally take over the user
experience ;)

>> I mean, in the context of
> >> a blog post .alignright is almost structural for the content. An image
> >> that's .alignright has a very specific semantic relationship with the
> >> paragraph that follows it (e.g. it might say 'the photo to the right'
> >> in the text).
> >
> > Those two classes aren't semantic. There is nothing about alignright that
> > says it must align to the right. It's not always aligned or floated to
> the
> > right even in WordPress core, which overrides it and flips it around for
> > sites that use RTL.
> To be clear, I wasn't saying that .alignright is itself actually a
> semantic bit of markup. Rather I was saying that the use of
> .alignright inside of a post is more than just a style decision, its a
> structural content decision, and thus semantic in the *intent* of the
> person using it on a photo . The fact that WP swaps the actual float
> for RTL is a perfect example: it is working with the intended semantic
> meaning of the right alignment rather than a specific style one.

I don't want to get into an argument over semantics, but classes that are
purely for presentation/design can only be called semantic, at a stretch, if
they add to the understanding of the content. I see where you are coming
from, but since class="alignright" actually aligns to the left in RTL
themes, and can in fact be made to align almost anywhere, there really isn't
any meaning to it. You could call it
class="completely-nonsemantic-presentational-element" and still use it the
exact same way ;)
I guess it could be argued that its "somewhat" semantic if it does align to
the right. Not convinced though!

On some level I'm just bemoaning the lack of an actual XHTML property
> that lets you control alignment, because I think alignment IS a
> structural issue within site content. Sure, <center> was a bad idea,
> but the fact is that when we are creating mixed-media content (photos,
> videos, pullquotes) we naturally want ways to control left and right
> alignment. Removing align="left" from html was a good idea because
> it's not how you should set up your site's sidebar, but its a shame
> because now our posts end up looking like 1995 when they're viewed
> using modern tools. I think it's pretty logically sound to say that
> right alignment of photos in a blog post is more than a 'style' issue,
> it's part of the content of the post. It just happens that CSS 'style'
> is the only means of achieving right alignment.

Sorry, disagree - its purely presentational. CSS allows styling, and HTML
itself never really controlled this, except by allowing inline styling.
Again, this is styling, not document structure.

> I think if nothing else floating of images deserves a spot as an
> exception to the rule against inline styles in posts. I also doubt you
> would even notice, let alone be upset or find usability problems with
> a  feed that used basic floating and margins on images to make the
> layout nicer (unless you get upset on principal, which is valid but
> probably not productive ;)

Styles have specificity and cascade. A few years back, some feed readers
were caught on the hop when people started applying styles to their feeds.
The result of this was that styled feeds were suddenly imposing their
styling on every subsequent feed in the cascade, when viewed in the reader.
This is not a problem if the reader/aggregator is displaying only one feed
item at a time. It's still a problem for people who display external feed
content on their own sites.

Think about it - if you use "alignright" on your site for content placement
when the site is viewed in a browser, and you import a feed to your site
which also uses "alignright", the feeds styling will override your own CSS
unless you have deliberately added specificity.  .alignright may be styled
to clear floats, adding padding or margins, to apply borders or whatever -
you get no control over this styling if its embedded in inlne styles. If a
site does not float images, and uses a feed that does, can you imagine the
screaming that would ensue?

I send an icon/logo with feeds, and I like seeing these in feeds I subscribe
to. However, RSS is XML for a reason - its pure data format for machines and
its designed to be display agnostic. To me, it becomes less than useful if
styling is applied to individual feeds - might was well go to the web page.
At least then,users get the option to view content with CSS off or go to
print view ;)

But that's just me. I've unsubscribed to feeds that have forced styling on
me, and the minute a feed throws in an image that is not meaningful to
content, they are deleted from my subscriptions. Your mileage may vary ;)


More information about the wp-hackers mailing list