how to add a selection in css

Solutions on MaxInterview for how to add a selection in css by the best coders in the world

showing results for - "how to add a selection in css"
Darwin
20 Mar 2019
1
2/* class applies to select element itself, not a wrapper element */
3.select-css {
4    display: block;
5    font-size: 16px;
6    font-family: sans-serif;
7    font-weight: 700;
8    color: #444;
9    line-height: 1.3;
10    padding: .6em 1.4em .5em .8em;
11    width: 100%;
12    max-width: 100%; /* useful when width is set to anything other than 100% */
13    box-sizing: border-box;
14    margin: 0;
15    border: 1px solid #aaa;
16    box-shadow: 0 1px 0 1px rgba(0,0,0,.04);
17    border-radius: .5em;
18    -moz-appearance: none;
19    -webkit-appearance: none;
20    appearance: none;
21    background-color: #fff;
22    /* note: bg image below uses 2 urls. The first is an svg data uri for the arrow icon, and the second is the gradient. 
23        for the icon, if you want to change the color, be sure to use `%23` instead of `#`, since it's a url. You can also swap in a different svg icon or an external image reference
24        
25    */
26    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'),
27      linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%);
28    background-repeat: no-repeat, repeat;
29    /* arrow icon position (1em from the right, 50% vertical) , then gradient position*/
30    background-position: right .7em top 50%, 0 0;
31    /* icon size, then gradient */
32    background-size: .65em auto, 100%;
33}
34/* Hide arrow icon in IE browsers */
35.select-css::-ms-expand {
36    display: none;
37}
38/* Hover style */
39.select-css:hover {
40    border-color: #888;
41}
42/* Focus style */
43.select-css:focus {
44    border-color: #aaa;
45    /* It'd be nice to use -webkit-focus-ring-color here but it doesn't work on box-shadow */
46    box-shadow: 0 0 1px 3px rgba(59, 153, 252, .7);
47    box-shadow: 0 0 0 3px -moz-mac-focusring;
48    color: #222; 
49    outline: none;
50}
51
52/* Set options to normal weight */
53.select-css option {
54    font-weight:normal;
55}
56
57/* Support for rtl text, explicit support for Arabic and Hebrew */
58*[dir="rtl"] .select-css, :root:lang(ar) .select-css, :root:lang(iw) .select-css {
59    background-position: left .7em top 50%, 0 0;
60    padding: .6em .8em .5em 1.4em;
61}
62
63/* Disabled styles */
64.select-css:disabled, .select-css[aria-disabled=true] {
65    color: graytext;
66    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'),
67      linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%);
68}
69
70.select-css:disabled:hover, .select-css[aria-disabled=true] {
71    border-color: #aaa;
72}
73
74
75body {
76  margin: 2rem;
77}
78
79//html
80<select class="select-css">
81    <option>This is a native select element</option>
82    <option>Apples</option>
83    <option>Bananas</option>
84    <option>Grapes</option>
85    <option>Oranges</option>
86</select>
87
Mya
19 Nov 2020
1
2.custom-select-wrapper {
3     position: relative;
4     user-select: none;
5     width: 100%;
6}
7 .custom-select {
8     position: relative;
9     display: flex;
10     flex-direction: column;
11     border-width: 0 2px 0 2px;
12     border-style: solid;
13     border-color: #394a6d;
14}
15 .custom-select__trigger {
16     position: relative;
17     display: flex;
18     align-items: center;
19     justify-content: space-between;
20     padding: 0 22px;
21     font-size: 20px;
22     font-weight: 300;
23     color: #3b3b3b;
24     height: 60px;
25     line-height: 60px;
26     background: #ffffff;
27     cursor: pointer;
28     border-width: 2px 0 2px 0;
29     border-style: solid;
30     border-color: #394a6d;
31}
32 .custom-options {
33     position: absolute;
34     display: block;
35     top: 100%;
36     left: 0;
37     right: 0;
38     border: 2px solid #394a6d;
39     border-top: 0;
40     background: #fff;
41     transition: all 0.5s;
42     opacity: 0;
43     visibility: hidden;
44     pointer-events: none;
45     z-index: 2;
46}
47 .custom-select.open .custom-options {
48     opacity: 1;
49     visibility: visible;
50     pointer-events: all;
51}
52 .custom-option {
53     position: relative;
54     display: block;
55     padding: 0 22px 0 22px;
56     font-size: 22px;
57     font-weight: 300;
58     color: #3b3b3b;
59     line-height: 60px;
60     cursor: pointer;
61     transition: all 0.5s;
62}
63 .custom-option:hover {
64     cursor: pointer;
65     background-color: #b2b2b2;
66}
67 .custom-option.selected {
68     color: #ffffff;
69     background-color: #305c91;
70}
71
72
Kira
23 Sep 2019
1
2<div class="custom-select-wrapper">
3    <div class="custom-select">
4        <div class="custom-select__trigger"><span>Tesla</span>
5            <div class="arrow"></div>
6        </div>
7        <div class="custom-options">
8            <span class="custom-option selected" data-value="tesla">Tesla</span>
9            <span class="custom-option" data-value="volvo">Volvo</span>
10            <span class="custom-option" data-value="mercedes">Mercedes</span>
11        </div>
12    </div>
13</div>
14
15
Emmalyn
18 Jun 2019
1
2/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */
3 html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
4     margin: 0;
5     padding: 0;
6     border: 0;
7     font-size: 100%;
8     font: inherit;
9     vertical-align: baseline;
10}
11/* HTML5 display-role reset for older browsers */
12 article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
13     display: block;
14}
15 body {
16     line-height: 1;
17}
18 ol, ul {
19     list-style: none;
20}
21 blockquote, q {
22     quotes: none;
23}
24 blockquote:before, blockquote:after, q:before, q:after {
25     content: '';
26     content: none;
27}
28 table {
29     border-collapse: collapse;
30     border-spacing: 0;
31}
32
33
Bruno
23 Oct 2017
1
2<select>
3    <option value="tesla">Tesla</option>
4    <option value="volvo">Volvo</option>
5    <option value="mercedes">Mercedes</option>
6</select">
7
8
Simona
11 Apr 2016
1
2*, *:after, *:before {
3     box-sizing: border-box;
4}
5
6
queries leading to this page
custom dropdown css htmlselect option css designcustom select lists html css dropdown selectselect in html csshtml select stylingchange style of selectstyling select dropdown bootstrapselect options stylestyling a select tagcombobox in html csshtml change style on selectstyling select tagstyle a select dropdown elementhow to style select option content cssinput 3a select csshtml select dropdown styledrop down css optionscss style select option dropdownselect tag css stylingstyle custom select jqueryhtml select style sheetstyle select options list in to buttons using cssstyle select cssstyle html select dropdownhtml css style option in selecthtml dropdown selected csscustom option tagcss for select optionhow to change select with cssstyle select options list in to button styling using cssstyle select option using css3style selectcustrom dropdownhtml custom dropdown inputselect boxstyle option dropdown csscss with optionselect menu stylecss style select completelycustom select option stylehow to style html5 selecthow to appy css on option of select htmlselect options csshtml styling selecthtml select css stylingselect css stylestyling select htmlcustomise the select input htmlhtml customize selecthtml styling optionscss style style option menucostume select option cssdropdown picker custom csshtmlcustomize select with htmlselect box htmlselect design in htmlcustomize option csshtml style select elementselect tag css propertiesstyle select option csshtml select tag stylingdesign select dropdown in cssselected in cssselect button stylinghtml customise selectcss custom selectcss select option stylecustom select css onlyselect taghow to customize dropdown in csshow to make a custom select htmlselect option style cssstyling css selectcreate select and dropdown cssstyle dropdown css onlyselect list csshtml css select boxapply custom styles to dropdowncss select boxselect list in html css select html csscustomize select dropdown csscss select itemschange color of text selection cssselect dropdown css style examplesselect dropdown text cssstyling a select tag using csscss input dropdown styledrop list custom csscss for dropdown selectset select csscustom select elementselect option stylingstyle select box drop down cssstyling dropdown htmlcss style dropdown selectcustomize select option containerbutton styling css selectcreate select csscss styling input select dropdown optionstyle select htmlhow to redesign select option csscustom select dropdown boxcss style select box option boxcss on select otptions boxhow to style select dropdown in cssstyle select itemscss button drop down selectcss select dropdowncustom select dropdown buttonhow to style html select optioncss select dropdown stylecustom css comboboxselect stylestyling a select tag with javascriptselect css optionshow to css select tagcss style dropwoncustom select field cssstyle dropdown button css selectstyling select option cssstyle select dropdown csscss select htmlhow to style select optionhow to add selection to all select in cssselect option styling in cssstyling a select dropdown 3cselect 3e element html and csscustomize select dropdowncreate select in cssselect dropdown cssstyling select csschange select option to button stylingselect option stylesstyle one elemet in a drop down listselect html customstyle seleect menu csscss select option style examplesstyle on selected buttonselect tag menu style bootstrapcss format select dropdowncss styling dropdownform select custom cssselect form stylehtml stylized dropdowncustomize dropdown csscustomize select optionsoptions cssstyle select tags with javascriptselect menu csscss option selectmodifying select options cssselect option css customizestyle html selectselect box css design as listselect stiledselect input designstyle select buttoncss select field buttonselect w3schools csscustom select dropdown css onlyselect arrow css w3schooldhtml select designselect style optionsoption in csshow to style select htmlbutton like options to select style csscss on selecthtml selectionadd css to seletcstyling dropdown in csscombobox html5 cddhow to style the select tag in htmlselect buttons cssselect options styling csshow to style select optionscss select customizehtml style select with cssselect custom htmlhow to style html selectjs custom selecthow to style select option csshow to edit select dropdown menu csscss selectmodify select option csscss input field combo stylestyle a select dropdownslect custom option htmlselect custom stylehtml option pickercustomize html input select with cssselectbox cssselect html designcss style for option selectcustom select dropdown cssselect dropdown stylingselect option csscombobox custom dropdown javascripthtml input select cssjavascript custom select dropdownselect css designcss stile select boxstyle select options list in to button styling using css using javascriptselect css style examplescss dropdown with selectorselect list html csscss change looks of select optionsswith style select inputchange select design csscustomizing a dropdown in a form using htmlcustom dropdown menuselect combobox html cssselect bar in htmlselect styling htmlstyle a select munu with csscustom option style csscss for option selecthtml css how to customize a selectdropdown custom csscustom select lists listselect field customizationjavascript to style select html elementstyle select in cssstyle select options list in to buttons using css javascriptdropdown customselectino box in cssother styles of select in htmlhow to design dropdown option in csscustom select style htmlcustom dropdown itemsstyling html selectcustom style select dropdown csscss style select menuhtml select css style exampleshow to custom css for select dropdowncss style dropdowncss select dropdown stylesstyle select as buttonoption dropdown style csscss select boxescustom select tag cssselect box css designdropdown css select option how to customize dropdown select csscss for selectcustomise html option list border radiuscss selcet optionsselect option in csssimple select dropdown cssselect tag stylingselect button csscustom select jsselection html css jscss custo dropdowncustom select option css onlyhow to select css in javascriptcustom css dropdowndesigning the select tagselect button stylescustomize select dropdown menuoption select csshow to custome style select in htmlstyle select liststyle select input csshow to custom select element cssstyle dropdown custom select box as listselect tag cssselect customcustom select option cssdropdown styling cssselect button stylecombo css selectorhtml select menu stylecustom select dropdown stylesstyle css selectcss styling select optionsselect custom style cssdesign select dropdownselect design in csscustomize select csscss for select box textstyle a select elementcustom style for selectselect field options css styleselect option css style exampleshow to customize select option cssscss form dropdown selectstyling select tag csscustom drodown in css and htmljavascript select style csscss select optionsselect form html cssselect stylingoptions select csscss create a optionchange style of select dropdownhow to beautify select option in cssstyle dropdown cssdropdown option css stylecustomize select tag cssselect css stylingcss select style completestyle a select tag using javascripthow to make a select box with csscss javascript optionhtml select scccss style select option no javascripthow to change selecr dropdown cssslect tag in html csscss selecectstyle options select cssform select with csscustom dropdown select htmlselect html style optionstyle select dropdownstyle the select dropdown csshow to style select box optioncool select form html cssstyle select option dropdown menuhow to set style to option in selectstyle option html csshow to add a selection in csscss edit dropdown selector stylehtml select menuscss menu selectionstyle select and optionsdropdown select option cssinput select style cssdiv css comboboxhtml default select customizationstyle a select box csscustom dropdown optionselect options in csshtml selectbutton select csshow to customize a select stylecustom dropdown select html cssdesign select dropdown boxselection csscss select buttonhtml select option custom stylecss style selectcss select stylescustom dropdown option csscss select box stylingstyling select options cssselect list style cssstyling slect html gformdropdown css stylinghow to do select box using css menu in htmlstyle bootstrap select options using css3selected html cssselect box in javascriptselect html css designstyling select tag in htmlselect style csscustom styles select box in htmlselect custom dropdown cssselect combox html csshow to make choice box on csshow to style option list html cssbootstrap 3 style select dropdowncss design code for optionsselect css customstyle select optioncombobox cssdesign select option csscss custom selection 3a 3aselect csscss select dropdown option styleselect css stylescss selectioncss style selctcustomize dropdown select cssstyle options cssdropdown css style optionsselect tag dropdown menu csshow to add selected to cssmodify selected dropbox cssselect box customadd to selection in csscss select box option styleapply styling on select tag cssselect button style csscustomize dropdown options cssselect to drowdown cssedit select csshow to change the dropdown option design csscss for select boxcombobox styles htmlselect box html csscustom style selection dropdownchanging select box color in html css and javasctriptselect option css stylecustomise select csshtml custom select buttons styleselect list option stylecss combobox selectmake select field html cssjetimage choose csshow to style a selectchange the select color cssselect box in htmlhtml css style select optionsstyling select dropdowncustom dropdownhow to style html select dropdown optionsselect csscustom select option html csscss form dropdown select styleselect dropdown in cssw3 html selecrthtml5 select style cssnew style for select boxhtml select buttons stylestyle the inside of selectcustom select button in htmlstyle select options csshow to style the selected element on a drop down 3cselect 3e stylingcustom dropdown cssselect frm cssselect field csshtml select stylesselect tag design csscss style only select inoutcss for select tagchange select stzleselect box css stylinghow to style select dropdown optionsoption style cssstyle option csshow to customize html selecthow to style dropdown csshtml custom selectstyle slelect optionstyling select menuhtml 2fcss 2c comboboxcustom select drodpwndiv select how do i style the selected option in a dropdown htmlcss custom dropdown selectcss option stylemodify browser css for selectto style a select optionselect box option css stylecreate a custom select optionhtml custom select listcustom select box cssinvitees select dropdown cssselect with cssselect box in tmlcss for select itemclass selsect menuhtml how to customize select dropdownsselectbox stylingdesigning select box cssstyle select options list in to button styling using css javascripthtml select csscustom select design cssselect css optionhow to style select option in htmldesign for all select input csscustomize option into select htmloption in html csscustom selection inputinput select stylecustomizable selectcustom select html cssselectbox dropdown selector cssselect box csscss3 custom dropdownselection htmlselect combobox csshow to add css for selcetdinput form select design in htmlselect dropdown cdd javascrip selector change stylehtml ooption csscss style optioncss select tagcustom option select cssstyling dropdown csscss comboboxcss format selectdropdown menu with selectorhtml select stylecss dropdown stylingcustom select box designselect button in html csshtml select dropdownhtml select option csshow to create select option in csscss selected astyle a selectchnage css of select and option dropdownselect in htmlcustom dropdown elementbeautify select csshtml syle selecthow to style a dropdown using csscss edit select dropdowncss design select optioncreate custom dropdown html csscustom select menu bootstrapcss dropdown selectcss dropdown input selectoption panel csscustom select tag using javascriptcss selchtml select css stylecustom select optioncss button selectcustom css select optionsstyle dropdown menu of select menucustomize 3a 3aselect css 22select html on css 22custom selectcss select custom styleselect in option csshow do i style the selected option in a dropdown csshtml dropdown styleoption html css styleselect tag designcreate custom select dropdown html csscustom option cssstyling custom selectcustom dropdown selecthow to make a customized select tagselect box dropdown selector csscss select stylingcss better selectselect dropdown in css inputselect form in css 3cselect 3e csshtml style selectselect box in html cssstyling a select tag using javascriptselect design csschange select option cssselect html css with whercoustemize select tagcutom dropdown htmlselect eith csscustomizable dropdown jsdropdown select customcss select options stylecustom table in select menu htmlselect option css stylecustom select menu htmlform select cssedit select styling csscustom select boxdropdowns html stylinghow to style only other option in select csshow to enable custom select csscustom drop down list cssselect custom optionhtml form select stylehtml style select cssstyle beauty select html cssdropdown edit cssselect css modifydropdown styling htmlselect menu design csscustom select dropdown html 5html css option stylecss custom dropdown menucss for select optionsselect tag button stylecss change select dropdown styleslect cssselectbox options in to button lookcustom select dropdown stylingcss 3cselect 3eselect option html cssdesign select csscustom select style cssselect boxes javascriptmake oprions csscss style button click on selectselect tag stylecss style option dropdownhtml css comboboxstyling select tags with javascripthtml select list csshow to change select box to buttons using csscss select stylecustom select dropdownhow to style the select option button in the htmlcss edit select optionhtml select button styleselesct cssselect css exampleshow to acustomize the dropdownselect css3 styleselect option styleselect dropdown custom csscss costumize selectstyle select tagschange select style jscustom dropdown using html cssinput select csshow to style select dropdownchange select csscss select option style buttonstyle dropdown select cssstyling select html select style optionsselect menu html designcss form select dropdownhalf select button cssctml css select optionstyle select option dropdown csscustomizing a dropdown using csscustom select menubeautiful select option border radiuscss select menuhow to customize select option in cssselection field styles csscss select optionselect box option popup custom designselect dropdown design csshow to use css on selectcss select with optionshtml css selecthow to add styles to select dropdownselect custom csshow to style selecthow to style dropdown optionscss sellect cssselect button cssselect dropdown style cssstyle option box csscustom dropdown select in html csssstyle select list csscss option selectorselected option in cssselect input cssstyle for option selectsimple style selectcustom select htmlcss javascript custom dropdowncustom select dropdown stylechange look of select csscustomize select option cssselect option html css stylehow to stylize dropdownhtml css select colorcustomize 3a 3aselect option csshtml cusom select boxcustomize the options inside conboboxcombo box html cssselect options custom cssedit select option styleoption tag csscustomize select boxcss style on selectcustom dropdown using csshow to style select form dropdownsselect in htmlcss optionmake a custom selectoption tag css stylehow to add image in select options in html w3schoolsselect element cssstyle select field csscss edit select list styecustom drop dwon listselect in cssselect html stylecss custom dropdownsimple css select dropdownhow to style select in cssselect csschange data according to product selection html csscustom select dropdown in cssdropdown with custom optionscustom css selectselect menu html csschange style of select cssdragdown stylingcustomize select optionselect option custom dropdownselect field css stylehtml select boxcss html option select option styleselect dropdown form csscss style select dropdowncss for select htmlhow to select button csshow to style the select elementselect option dropdown csshtml css select stylecustom select cssoption cssstyled select tag css htmlcss for select itemscss div as selectbeatiful forms with select dropdowns cssjavascript class custom selectchange select optionmenulist stylecoustom dropdownhow to style select box in cssdesign the select options in csshow to add a selection in css