tags:

views:

27

answers:

1

Should width be treated instead with an html attribute?

I know about left and right margin for setting horizontal position, but the validation messages from my javascript are being messed up when using

margenleft{
             margin-left:120px;
        }

on a different resolution, how can I do this relatively? I want the select elements to be centrally placed.

+2  A: 

If you change the select to display: block, you can centre and set its width with the following CSS:

select {
   /* Set as display block and auto left/right margins to centre */ 
   display: block;
   margin: 0 auto;

   /* Set select's width */
   width: 200px;       
}

And for your viewing pleasure, an example.

Pat
what does display:block does?
omgzor