我有一个带有非常长文本选项的html选择。我想知道如何将选项的最大宽度设置为自动换行。
例如,我想选择以100px包裹:
<select style="width:100px">
<option>
skdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk nd
</option>
<option>
skdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk nd
</option>
<option>
skdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk nd
</option>
<option>
skdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk nd
</option>
<option>
skdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk nd
</option>
<option>
skdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk ndskdfnsdjfn skdjfn sjkdn sdjkn sdjk nsdjkf nsdjkf nsdjkfn sjkf nsdjk nd
</option>
</select>
答案 0 :(得分:1)
您不能使用标准选项选择进行自动换行。您必须使用第三方工具或自己动手。