aligning text of select |
This is a discussion on aligning text of select within the CSS forums, part of the Development category; hi i want to align the text of select tag in the center by default the text of the select ... |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Member Join Date: Sep 2009
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
![]() Expertise: Total Beginner Experience: Basic / None |
hi i want to align the text of select tag in the center by default the text of the select appears left. this is working in all browsers except for ie6 and 7 and safari following is my code #div select{ text-align: center; } how do i get ie and safari to align the text of select in the center as with the above code the text appears left for ie6 and 7 and safari thanks |
| | |
| | #2 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,624
Blog Entries: 6 Thanks: 15
Thanked 51 Times in 51 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
hmmm, I would have thorght that should work across all browsers have you tried just using margin left instead or possibly padding ? post a link or post the html and css so we can have a look
__________________ web design kent |
| | |
| | #3 |
| Member Join Date: Sep 2009
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
![]() Expertise: Total Beginner Experience: Basic / None |
thanks for replying following is my code <div id="row1"> <form action="#"> <select> <option>1</option>... </select> </form> </div> #row1{ float: left; width: 186px; height: auto; margin: 0 0 0 0; padding: 10px 0 5px 0; text-align: right; // this is needed as the select needs to be right aligned } #row1 select{ width: 50px; text-align: center; } if i use margin or padding then it will be an approximation however if text-align: center can work it will be accurate even if the text increases or decreases for all browsers. thanks. |
| | |
| | #4 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,624
Blog Entries: 6 Thanks: 15
Thanked 51 Times in 51 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional | what is that about ? basically what is happening is you are telling it to go right, but then moving it to the middle so each browser is 'guessing' to what you really what to do with it its like me saying to you to turn right and go straight on at the same time if I were handing you directions.. it just cant be done please tell me why you have done that as I would never see any reason for that also, from what I can tell... this height: auto; and this margin: 0 0 0 0; are doing nothing at all, it looks like pointless code
__________________ web design kent |
| | |
![]() |
| Tags |
| aligning, select |
| Thread Tools | |
| Display Modes | |