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

Lynne Pope lynne.pope at
Wed Jun 17 07:34:50 GMT 2009

2009/6/17 Joost de Valk <joost at>

> Disclaimer: I didn't follow this thread entirely, so sorry if I say
> something that's already been said.
> Wouldn't it be cool if WordPress automatically replaced class="alignright"
> and "alignleft" etc with good inline CSS? That's always annoyed me a bit...
> Might make a plugin for that, since it's actually pretty darn easy to do,
> but still, shouldn't that be in core?
> Best,
> Joost

Nope, sorry, disagree. Having it simply as a class allows for easy
customisation. As it is, alignright and alignleft are styled differently for
global.css and RTL (where they get swapped around).

One day there will be loads of admin themes being developed by 3rd party
developers and they would end up having to hack the core to get rid of
inline styles ;)

Here's why...
Inline styles apply only to the element they are set on. They take
precedence over everything else in the cascade. Its impossible to style
pseudo-elements and -classes with inline styles and impossible to override
them in external CSS.
Added to this, the maintenance involved in any UI changes that rely on admin
themes would increase exponentially.

So, -100 for me on this one. If any change was to be made to alignright and
alignleft the only one I would like to see is a more semantic class name.


More information about the wp-hackers mailing list