英文:
HTML remove space between integer and fraction when using ⁄
问题
要去掉混合数中整数部分(例如2)和分数部分(例如7/16)之间的空格,可以使用以下代码:
2<span style="white-space: nowrap;">7⁄16</span>
这将在2和分数之间创建一个不换行的空间,使其显示为 27⁄16。这可以看作是 的一种变种,用于创建一个不换行的空间。
英文:
How can I remove the space in a mixed number between the whole number (e.g. 2) and the fraction (e.g. 7⁄16) when using &frasl;?
2 7&frasl;16 displays 2 7⁄16 (w/ a space between 2 and the fraction)
27&frasl;16 displays 27⁄16
So it display as... 2&frac16; as this would for 2⅙
Is there a code, essentially the 'reverse' of &nbsp; for an 'empty space'?
答案1
得分: 1
你可以使用零宽度不连接字符 (&zwnj;)(https://htmlhelp.org/reference/html40/entities/special.html)
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
2&zwnj;7&frasl;16
<!-- end snippet -->
英文:
You could use a zero-width non-joiner character (&zwnj;)(https://htmlhelp.org/reference/html40/entities/special.html)
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
2&zwnj;7&frasl;16
<!-- end snippet -->
答案2
得分: 0
这似乎有效:
2&#173;7&frasl;16 生成 2­7⁄16
我可以接受这样,不过如果有更好的方法,请建议。
英文:
This seems to work:
2&#173;7&frasl;16 produces 2­7⁄16
I can live with that, though if there are better ways to do this, please advise.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论