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

H

How Can We Help?

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

  • 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;
    }

About the author

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.

About Author

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.

Follow Me