0

we have Brand and model dropdown boxes looking like this link as below image

enter image description here

I want to make like this :

enter image description here

css

#brand_select
{
color: #000000; 
text-transform: capitalize;
font-size:17px;
font-weight:bold;
letter-spacing: 1px;
}



#model_select
{
color: #000000; 
text-transform: capitalize;
font-size:17px;
font-weight:bold;
letter-spacing: 1px;
}

html

<?php

$brandSelect = '<select id="brand_select">';
$brandSelect .= '<option value="">My Brand</option>';

<select id="model_select"><option value="">My Model</option></select>'

?>

we want to Display My model below My Brand also want to give space between My Brand text and dropdown symbol.

fresher
  • 917
  • 2
  • 20
  • 55
  • Possible duplicate of [How to style a – Vivekraj K R Jul 13 '16 at 10:59
  • Can we have some code to base on ? The CSS you gave us looks like only a part of your code, and maybe some html if your divs are inside a container or something. – Relisora Jul 13 '16 at 11:02
  • @Relisora please check updated question. – fresher Jul 13 '16 at 11:13

3 Answers3

3

You can add static width to dropdowns, for example width: 150px;

Here is working example: https://jsfiddle.net/Mindaugas/17eLs0oz/

Mindaugas M.
  • 121
  • 2
  • 6
1

you can put your select elements inside a div element for them to be as you want.

for the space between the boxes you can use padding.

for the space between the text and the dropdown symbol you can use width.

you may see an example here: https://embed.plnkr.co/NypAPGHZmrBjh88nZfnW/

nitzanerman
  • 104
  • 1
  • 6
1

This is what I did to achieve the attached image. Not very neat but I hope you get the point.

select{
            -webkit-appearance: none;
            border: 2px solid #bbb;
            background: #fff;
            padding: 10px;
            width: 200px;
            background: url(downarrow.png) no-repeat right white;
            z-index: 100;
        }

My test form