Link to home
Start Free TrialLog in
Avatar of axessJosh
axessJosh

asked on

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

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.
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

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
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial