[WSG] Styling option [Forms]

2007-11-04 Thread James Jeffery
Hi all

I have a select box that has a greater width and hight then the
standard size. I am trying to center the default option that displays
in the select box. I have tried padding: xem 0; and it centers the
options when the list is displayed, but the default option does not
change.

Basically i want to center (vertically) the default option in a select box.

Anyone got any ideas i have tried for a while and can't get it to work.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Styling option [Forms]

2007-11-04 Thread Chris Knowles
James Jeffery wrote:
 
 I have a select box that has a greater width and hight then the
 standard size. I am trying to center the default option that displays
 in the select box. I have tried padding: xem 0; and it centers the
 options when the list is displayed, but the default option does not
 change.
 
 Basically i want to center (vertically) the default option in a select box.

Hi James

you can get varying results by setting text-align: center on the select
itself and on the option elements but not in IE - I don't think theres
any way to control it in IE at all.

-- 
Chris Knowles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Styling option [Forms]

2007-11-04 Thread akella
Hi James

May be you'd better start thinking about one of those replacement techniques.
This for instance http://easy-designs.net/articles/replaceSelect/

On 11/5/07, Chris Knowles [EMAIL PROTECTED] wrote:
 James Jeffery wrote:
 
  I have a select box that has a greater width and hight then the
  standard size. I am trying to center the default option that displays
  in the select box. I have tried padding: xem 0; and it centers the
  options when the list is displayed, but the default option does not
  change.
 
  Basically i want to center (vertically) the default option in a select box.

 Hi James

 you can get varying results by setting text-align: center on the select
 itself and on the option elements but not in IE - I don't think theres
 any way to control it in IE at all.

 --
 Chris Knowles


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




-- 
С уважением,
Юрий akella Артюх
http://cssing.org.ua

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] Styling option [Forms]

2007-11-04 Thread Tee G. Peng


On Nov 4, 2007, at 5:27 AM, James Jeffery wrote:


Hi all

I have a select box that has a greater width and hight then the
standard size. I am trying to center the default option that displays
in the select box. I have tried padding: xem 0; and it centers the
options when the list is displayed, but the default option does not
change.

Basically i want to center (vertically) the default option in a  
select box.


Anyone got any ideas i have tried for a while and can't get it to  
work.


When I run into this problem, I declare width for 'select'.

select {width: 250px}

If I want to style the option values in Firefox, I add a class like so

.option {border-bottom : 1px solid #efefefe; padding: 3px
;width: 250px}

If a class is added, I don't declare width in 'select'.

IMHO, this looks so much better than making text center just for the  
Gecko based browsers. I do care the aesthetic inspiration, but using  
JS to overwrite browser default for option attribute isn't something  
I aspire :)


'width' works for all browsers I have tested : Safari, IE, Opera,  
Firefox and Camino
'text-align' only work in Opera and Firefox. In Camino, only the  
first option value works.


tee


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***