我正在搜索实际的垂直文本,而不是HTML中的旋转文本,如下所示。所以我可以使用以下方法来实现。HTML:-<p class="vericaltext">Hi This is Vertical Text!</p>CSS:.vericaltext{ width:1px; word-wrap: break-word; font-family: monospace; /* this is just for good looks */}更新:-如果需要显示空格,则将以下属性添加到CSS中。white-space: pre;因此,css类应为.vericaltext{ width:1px; word-wrap: break-word; font-family: monospace; /* this is just for good looks */ white-space: pre;/* this is for displaying whitespaces */}由于 white-space: pre;在Firefox(到目前为止)上似乎不起作用(针对此特定用途),因此只需将该行更改为white-space: pre-wrap;因此,css类应为.vericaltext{ width:1px; word-wrap: break-word; font-family: monospace; /* this is just for good looks */ white-space:pre-wrap; /* this is for displaying whitespaces including Moz-FF.*/}