简体   繁体   中英

JQuery: How to Change text color of multiselect

I have a multi-select for month list drop down menu which will choose multiple options.I used JQuery Multiselect.js and this is the code: Notice: CDN Links Don't work here.But i've lib file that works fine.

 <!doctype html> <html> <head> <meta charset="utf-8"> <title>Multi-select Dropdown List with Checkbox by CodexWorld</title> <link href="https://cdn.jsdelivr.net/jquery.multiselect/1.13/jquery.multiselect.css" rel="stylesheet" type="text/css"> <style> body { font-family:'Open Sans' Arial, Helvetica, sans-serif} ul,li { margin:0; padding:0; list-style:none;} .label { color:#000; font-size:16px;} </style> </head> <body> <h2>jQuery MultiSelect Basic Uses</h2> <select name="langOpt[]" multiple id="langOpt" > <option value="All">All</option> <option value="Jan">January</option> <option value="Feb">February</option> <option value="Mar">March</option> <option value="Apr">April</option> <option value="May">May</option> <option value="Jun">June</option> <option value="Jul">July</option> <option value="Aug">August</option> <option value="Sep">September</option> <option value="Oct">October</option> <option value="Nov">November</option> <option value="Dec">December</option> </select> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/jquery.multiselect/1.13/jquery.multiselect.js"></script> <script> $('#langOpt').multiselect({ placeholder: 'Select Months' }); </script> </body> </html> 

Code works Fine.Right now the multi select has the following default text color which very fade.

在此处输入图片说明

But I want to change the text color to black.How can i do it please help.thanks

You are trying to change the color of a placeholder.

See here Change an HTML5 input's placeholder color with CSS

Try this:

.ui-multiselect {
    color: #000;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM