Skip to content

Instantly share code, notes, and snippets.

@harunpehlivan
Created May 28, 2021 20:44
Show Gist options
  • Select an option

  • Save harunpehlivan/4655ed4ffdd6b02091919deacfac598b to your computer and use it in GitHub Desktop.

Select an option

Save harunpehlivan/4655ed4ffdd6b02091919deacfac598b to your computer and use it in GitHub Desktop.
Datalist Example
<div id="page-wrapper">
<h1>Datalist Example</h1>
<label for="default">Pick a programming language</label>
<input type="text" id="default" list="languages" placeholder="e.g. JavaScript, HTML, CSS">
<datalist id="languages">
<option value="HTML">
<option value="CSS">
<option value="JavaScript">
<option value="Java">
<option value="Ruby">
<option value="PHP">
<option value="Go">
<option value="Erlang">
<option value="Python">
<option value="C">
<option value="C#">
<option value="C++">
</datalist>
</div>
*,
*:before,
*:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-family: Helvetica, Arial, sans-serif;
font-size: 100%;
background: #333;
-webkit-font-smoothing: antialiased;
}
#page-wrapper {
width: 640px;
background: #FFFFFF;
padding: 1em;
margin: 1em auto;
border-top: 5px solid #69c773;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
h1 {
margin-top: 0;
}
label {
display: block;
margin-top: 2em;
margin-bottom: 0.5em;
color: #999999;
}
input {
width: 100%;
padding: 0.5em 0.5em;
font-size: 1.2em;
border-radius: 3px;
border: 1px solid #D9D9D9;
}
button {
display: inline-block;
border-radius: 3px;
border: none;
font-size: 0.9rem;
padding: 0.5rem 0.8em;
background: #69c773;
border-bottom: 1px solid #498b50;
color: white;
-webkit-font-smoothing: antialiased;
font-weight: bold;
margin: 0;
width: 100%;
text-align: center;
}
button:hover,
button:focus {
opacity: 0.75;
cursor: pointer;
}
button:active {
opacity: 1;
box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.1) inset;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment