W3C home > Mailing lists > Public > www-style@w3.org > January 2011

<option> and text-align

From: Aharon (Vladimir) Lanin <aharon@google.com>
Date: Wed, 19 Jan 2011 16:56:03 +0200
Message-ID: <AANLkTinyh62KT+OahChf9AygHCo9MVy4tTRscAG4c_n=@mail.gmail.com>
To: W3C style mailing list <www-style@w3.org>
Does anyone have an informed opinion whether the CSS spec defines, should
define, or even can define the effect of setting text-align on an <option>
element? I am not talking about the placement of the <select> on the page
here, but of a particular <option>'s text in the select control - in the
dropdown (if any), and after the <option> has been chosen. Try the
attachment in Firefox and in a different browser to see what I am talking

The situation I see now:

Firefox 3.6.13: In drop-down, obeys explicit text-align value on option; if
text-align is not specified, the option is aligned on its direction's start
edge. After an option has been chosen and drop-down disappear, the value is
aligned to the select direction's start-edge, i.e. option's text-align (and
direction) are no longer followed.

IE 8, Chrome 8.0, Opera 11 : Option's text-align and direction have no
effect on its alignment, both in the drop-down and after the option has been
chosen. In all cases, all options are aligned to the select direction's
start edge.

Safari (for Windows) 5.0.3: Always left-aligned. (Even when everything is
dir=rtl... Looks like a bug)

Now, if you say that text-align can and should control the alignment of an
option, what should the default text-align value be for option? Currently,
the default value is "start" for the root element, and inherited by all
others. As we have already said, however, inheritance does not seem to play
any role for option alignment in any browser: Firefox behaves as if the
option's default text-align is "start", and the others don't care one way or
the other. But should it really be "start" the way Firefox seems to behave,
or should it be the new match-parent? If it were match-parent, the default
behavior would be for all options to line up to the select direction's start
edge - the way that IE 8, Chrome 8.0, Opera 11 currently have it - but it
could be controlled (as in Firefox 3.6.13) by setting it to a different
value. That would be my vote - if text-align were to have any effect at all
on option, that is.


Received on Wednesday, 19 January 2011 14:56:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:54 UTC