HTML

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

Written by Ian Carnaghan · 19 sec read >
  • You can use external CSS (Cascading Style Sheets) or Inline StylesNOTE: 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;
    }

Last Updated On March 22, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. In my spare time I teach undergraduate classes in web development. Profile

Leave a Reply

avatar
  Subscribe  
Notify of