HTML Select not showing default text or selected text - drop down showing items correctly

axessJosh
axessJosh used Ask the Experts™
on
I have an HTML Select not showing default text, also not showing selected text.

When clicked, the drop down shows the values, and the user is able to select items properly.  The search feature is working it is just not showing which items were selected.

I'm not sure if this is a browser update issue or something I can control.

The example is at http://fbcolifegroups.com

thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
It's down to the styles you've set. You're setting the height of your <select> to 3rem and then you're setting a padding on it that's so large that you're effectively moving the text out of view. Either remove the height of the <select> or reduce the padding:

search-form-styles.css - line 42 // height is set here
the-core-styles.css - line 723 // padding is set here
You forgot to identify your default "option" as selected

Example

Change
<select name="meeting-time"><option value="">Select Meeting-time</option><option value="1100-am">11:00 AM</option><option value="830-am">8:30 AM</option><option value="940-am">9:40 AM</option></select>

Open in new window


to
<select name="meeting-time"><option value="" selected>Select Meeting-time</option><option value="1100-am">11:00 AM</option><option value="830-am">8:30 AM</option><option value="940-am">9:40 AM</option></select>

Open in new window

Hi,

Don't forget to change line 711
I have commented the padding and it is working fine
the-core-styles.css

select {
  background: #fff;
  color: #1f1f1f;
  font-family: 'Quattrocento Sans';
  font-size: 16.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0px;
  line-height: 28px;
 /* padding: 12px 15px; */
  border: 1px solid rgba(0, 0, 0, 0.13);
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  outline: none;
  width: 100%;
}

Open in new window


But I would not use UL /LI to display Select input.
You can use column instead or use  display: inline; or display: inline-block
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
@lenamtl - If you change line 723, there's no need to change line 711. Changing line 711 will change the padding on ALL inputs, not just the <select> ones.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial