-1

How can I make a drop down option with a input box using css and html like the picture below?

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57

3 Answers3

2

I guess then you need a combo box. A simple way to implement it is with the datalist like this:

    <!DOCTYPE html>
    <html>
    <body>

    <input type="text" name="example" list="exampleList">
    <datalist id="exampleList">
        <option value="017">
        <option value="018">
        <option value="019">
    </datalist>
      
    </body>
    </html>
Anastasios Selmani
  • 3,579
  • 3
  • 32
  • 48
1

I guess u require the select statement for the drop down

  <!DOCTYPE html>
     <html>
     <body>
     <select id="exampleList">
            <option value="017">017</option>
            <option value="018">018</option>
            <option value="019">019</option>
     </select>    
     </body>
     </html>

this will create the dropdown list

nikhil kumar
  • 55
  • 1
  • 10
0

Modify as your need

<!DOCTYPE html>
    <html lang="en">
    <body>
     <h2>This is what you want </h2>
      <center>
    <select style="height: 36px; border-right: 4px solid; width: 55px; background: transparent;">
    <option value="India">+91</option>
    <option value="India">+92</option>
    <option value="India">+93</option>
    <option value="India">+94</option>
    <option value="India">+01</option>
    </select>
    <input type="text" style="height: 30px; margin-left: -4px; padding-left: 5px;">
    </center>

    </body>
    </html>
Uday Kumar
  • 121
  • 1
  • 10