Web Analytics Made Easy -
StatCounter textbox and select box width equal?? - CodingForum

Announcement

Collapse
No announcement yet.

textbox and select box width equal??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • textbox and select box width equal??

    how to give equal width/size for a input type textbox or select box for all the browsers (ex: Ie7, FF2 and 3 etc..)

    Code:
    <input type="text" size="20" value="" />
    Now this size varies in different browsers. So I used
    Code:
    <input type="text" value="" style="width:150px;" />
    This worked properly.

    But when I do this styling for select box its not happening.
    Code:
    <select name="123" style="width:150px;"><option>eeee</option><option>rrrr</option></select>
    The point is I want the text box and the select box width to be same when I am using them largely in forms..

    Anyone knows the solution?? :burnt:

  • #2
    I think that select boxes get the width of the largest option. Styling with css seems to be the right solution. Try adding overflow:hidden; in select boxe' s style too.

    Comment


    • #3
      thanks for your reply.
      I tried giving styles for select box using class names but it worked fine for Ie7 and FF3, but firefox 2 takes select box as a lengthy one...

      Any solutions to make them appear equally in all browsers??

      Comment


      • #4
        Short answer : not possible, as IE considers input elements like <select>, checkbox, radio, file etc differently.

        However, you could use nice forms, a progressive enhancement approach.
        Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

        Comment

        Working...
        X