Home HTML How to adjust the width of a HTML combobox (Drop down box or Select box)?
 
 
 

How to adjust the width of a HTML combobox (Drop down box or Select box)?

PDF Print E-mail

Question: How to adjust the width of a HTML combobox (Drop down box or Select box)?

 

Answer:

  • You can use external CSS (Cascading Style Sheets) or Inline Styles. NOTE: External CSS stylesheets are best to use. 
  • Example using inline styles.
    <select style="width:200px;">
        <option>Option 1</option>
        <option>Option 2</option>
        <option>Option 3</option>
    </select>
    
  • Example using external CSS

    HTML

    <select class="dropdown">
         <option>Option 1</option>
         <option>Option 2</option>
         <option>Option 3</option>
     </select>
     


    CSS

    .dropdown{
        width: 200px;
    }
    
+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!

 
Banner

$1.99/mo Web Hosting

Spring Savings! $7.49 .com domain

Phoca

Phoca Gallery


Recommended service:
site monitoring