Dani Vilardell | d4bfb75 | 2020-09-21 21:32:55 +0200 | [diff] [blame] | 1 | * { box-sizing: border-box; } |
| 2 | body { |
| 3 | font: 16px Arial; |
| 4 | } |
| 5 | .autocomplete { |
| 6 | /*the container must be positioned relative:*/ |
| 7 | position: relative; |
| 8 | display: inline-block; |
| 9 | } |
| 10 | input { |
| 11 | border: 1px solid transparent; |
| 12 | background-color: #f1f1f1; |
| 13 | padding: 10px; |
| 14 | font-size: 16px; |
| 15 | } |
| 16 | input[type=text] { |
| 17 | background-color: #f1f1f1; |
| 18 | width: 100%; |
| 19 | } |
| 20 | input[type=submit] { |
| 21 | background-color: DodgerBlue; |
| 22 | color: #fff; |
| 23 | } |
| 24 | .autocomplete-items { |
| 25 | position: absolute; |
| 26 | border: 1px solid #d4d4d4; |
| 27 | border-bottom: none; |
| 28 | border-top: none; |
| 29 | z-index: 99; |
| 30 | /*position the autocomplete items to be the same width as the container:*/ |
| 31 | top: 100%; |
| 32 | left: 0; |
| 33 | right: 0; |
| 34 | } |
| 35 | .autocomplete-items div { |
| 36 | padding: 10px; |
| 37 | cursor: pointer; |
| 38 | background-color: #fff; |
| 39 | border-bottom: 1px solid #d4d4d4; |
| 40 | } |
| 41 | .autocomplete-items div:hover { |
| 42 | /*when hovering an item:*/ |
| 43 | background-color: #e9e9e9; |
| 44 | } |
| 45 | .autocomplete-active { |
| 46 | /*when navigating through the items using the arrow keys:*/ |
| 47 | background-color: DodgerBlue !important; |
| 48 | color: #ffffff; |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 49 | } |
| 50 | |