html - Changing a select drop-down list to an unordered list -
i created drop-down menu select , option tags, these not allow me link other web pages, read had create un-ordered list because create drop-down incorrectly.
here's code looks like: https://jsfiddle.net/pferdefleisch/q7hnj/1/
<select id="one"> <option value = "catalouge"> <a href = "catalouge.html">product catalouge</a> </option> <option> vacuum components </option> <option> valve components </option> <option> roughing components </option> <option> vacuum measurement </option> <option> glass components </option> <option> electrical feedthroughs </option> <option> motion , manipulation </option> <option> thin film products </option> </select>
css:
#one { margin: 10px; padding: 10px; width: 20%; font-family: palatino linotype; font-size: 15px; -moz-appearance: none; -moz-box-shadow: 0 3px 0 #ccc, 0 -1px #2961c1 inset; box-shadow: 0 3px 0 #ccc, 0 -1px purple inset; list-style: none; position:absolute;top:23%;left:2%; }
how transform normal drop-down list?
it looks you're using selection drop-down. here fiddle made of how want it. fiddle purely html , css.
https://jsfiddle.net/2q3kkh8n/2/
the html
<div id="dropdown-container"> <div id="dropdown">product catalogue <span class="down-arrow-icon">><span> </div> <ul id="dropdown-list"> <li><a href="#">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> <li><a href="#">four</a></li> </ul> </div>
and css:
#dropdown-container{ float: left; font-family: palatino linotype; } #dropdown{ padding:5px; cursor:pointer; font-size: 15px; border: 1px solid rgb(169, 169, 169); -moz-appearance: none; -moz-box-shadow: 0 3px 0 #ccc, 0 -1px #2961c1 inset; box-shadow: 0 3px 0 #ccc, 0 -1px purple inset; } .down-arrow-icon{ padding-left: 5px; /*place img of down arrow here*/ } #dropdown-list{ display:none; width: 100%; padding:0px; margin:0px; border: 1px solid rgb(169,169,169); } #dropdown-container:hover ul#dropdown-list{ display:block; } #dropdown-container ul{ padding:0px; list-style: none; } #dropdown-container ul li{ width: 100%; } #dropdown-container ul li:hover{ background-color: lightblue; cursor:pointer; } #dropdown-container ul li a{ padding-left: 10px; text-decoration:none; color: black; }
i hope helps.
Comments
Post a Comment