CSS property word-wrap not working for select element on Firefox -
i have 1 html dropdown. in dropdown, of options have long strings without spaces. want wrap such options next line. used css word-wrap
property. works fine me in chrome, not in firefox.
i tried using word-break
property suggested in suggested duplicate
i made a demo on jsfiddle. looks fine on chrome, if open demo on firefox, text fails wrap. how can fix this?
.setwidth { width: 300px }
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-4"> <select class="formnameslist setwidth" id="customcategories" name="customcategories" size="15"> <option value="10085240">_1test_today</option> <option value="10085242">_1test_today_a</option> <option value="10085091" style="word-wrap:break-word">testcust_copyfinal_copytetshhshshshhshshhshshshhshshhshshhshshshshhshshshshhshshshshhshshhshs</option> </select> </div>
no, cannot wrap
text in native select. can use jquery plugins achieve this. here more details
still may try , see if works:
break-word indicates unbreakable words may broken @ arbitrary points if there no otherwise acceptable break points in line.
pre sequences of whitespace preserved, lines broken @ newline characters in source , @
elements.
pre-wrap sequences of whitespace preserved. lines broken @ newline characters, @
, , necessary fill line boxes.
word-wrap: break-word; /* ie*/ white-space: -moz-pre-wrap; /* firefox */ white-space: pre-wrap; /* other browsers */ width:150px; display:inline-block
Comments
Post a Comment