HTML Double Click Selection Oddity

前端 未结 3 647
予麋鹿
予麋鹿 2020-12-30 06:47

I didn\'t post this on DocType because it\'s not really a design thing, the visual representation isn\'t my problem, the behaviour is. I\'m sorry if th

相关标签:
3条回答
  • 2020-12-30 07:06

    If you put a non-breaking space (  or \u00A0) or just a empty space (" ") between each span, it will separate the words and prevent the double-click selection from spilling into adjacent spans.

    If you don't want to see a visible space, use a zero-width space (​ or \u200B).​​​

    0 讨论(0)
  • 2020-12-30 07:16

    I suspect that if you include a space or a non-breaking space &nbsp between your two elements, you will find that you can double-click, and select only one but not both elements, as the browser will no longer see the two elements as a single word.

    0 讨论(0)
  • 2020-12-30 07:22

    I had the same problem. If you put a space before the closing tag of your li that should fix it.

    <ul style="overflow: hidden;">
        <li style="float: left;"><strong>SKU:</strong>123123 </li>
        <li style="float: left;"><strong>ILC:</strong>asdasdasdasd </li>
    </ul>
    
    0 讨论(0)
提交回复
热议问题