Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is difficult to style select menu with css. The Best way of doing it is with jquery u can style and have a better control over the code with jquery. Just use a custom jquery like <a href="http://gregfranko.com/jquery.selectBoxIt.js/" rel="nofollow noreferrer">http://gregfranko.com/jquery.selectBoxIt.js/</a></p> <p>I have just made an example of styling select with jquery, you can check the demo here</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>// Code to convert select to UL $('.select').each(function() { var $select = $(this).find('select'), $list = $('&lt;ul /&gt;'); $select.find('option').each(function() { $list.append('&lt;li&gt;' + $(this).text() + '&lt;/li&gt;'); }); //Remove the select after the values are taken $select.after($list).remove(); //Append Default text to show the selected $(this).append('&lt;span&gt;select&lt;/span&gt;') var firsttxt = $(this).find('li:first-child').text(); $(this).find('span').text(firsttxt) // On click show the UL $(this).on('click', 'span', function(e) { e.stopPropagation(); $(this).parent().find('ul').show(); }); // On select of list select the item $(this).on('click', 'li', function() { var gettext = $(this).text(); $(this).parents('.select').find('span').text(gettext); $(this).parent().fadeOut(); }); }) // On click out hide the UL $(document).on('click', function() { $('.select ul').fadeOut(); });</code></pre> <pre class="snippet-code-css lang-css prettyprint-override"><code>body { font-family: 'arial', san-serif; } .select { width: 200px; height: 30px; border: 1px solid #ddd; line-height: 30px; position: relative; margin-bottom: 40px; } .select span { display: block; color: #333; font-size: 12px; padding: 0 10px; } .select ul { display: none; background: #fff; border: 1px solid #ddd; min-width: 300px; position: absolute; top: 100%; left: 0; list-style-type: none; margin: 0; padding: 0; z-index: 10; } .select ul &gt; li { font-size: 12px; } .select ul &gt; li { color: #333; display: block; padding: 2px 8px; text-decoration: none; line-height: 24px; } .select ul &gt; li:hover { background: #e4f4fa; cursor: pointer; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;label&gt;First Select&lt;/label&gt; &lt;div class="select"&gt; &lt;select&gt; &lt;option&gt;Item&lt;/option&gt; &lt;option&gt;Item 2&lt;/option&gt; &lt;option&gt;Item 3&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;label&gt;Second Select&lt;/label&gt; &lt;div class="select"&gt; &lt;select&gt; &lt;option&gt;this 1&lt;/option&gt; &lt;option&gt;this 2&lt;/option&gt; &lt;option&gt;this 3&lt;/option&gt; &lt;/select&gt; &lt;/div&gt;</code></pre> </div> </div> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload