gpt4 book ai didi

javascript - 如何垂直书写/显示文本?

转载 作者:太空宇宙 更新时间:2023-11-04 16:11:44 25 4
gpt4 key购买 nike

我正在尝试按照下面的描述转换文本。

02 比赛日

0
2
M
a
t
c
h
d
a
y

我的代码在下面给出.. 当前结果并不像我想要的那样准确。请给我建议。

table {border-collapse:collapse;}
td span {display:block;}
.sideways {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
}
/*put specifics here*/
table tr:nth-of-type(1) td:nth-of-type(1) {background-color:tomato;}
table tr:nth-of-type(1) td:nth-of-type(2) {background-color:red;}
table tr:nth-of-type(1) td:nth-of-type(3) {background-color:chocolate;}
table tr:nth-of-type(1) td:nth-of-type(4) {background-color:black;}
table tr:nth-of-type(1) td:nth-of-type(5) {background-color:grey;}
<table>
<tr>
<td rowspan="3"><span class="sideways">O2 Matchday</span></td>
</tr>
<tr>
<td>My O2 for Windows</td>
</tr>
<tr>
<td colspan="2">Blipdrop</td>
<td>My O2 for business</td>
</tr>

</table>

最佳答案

你可以试试这个: http://jsfiddle.net/lotusgodkk/GCu2D/1013/

CSS:

div {
font-size: 20px;
width: 15px;
overflow: hidden;
word-break: break-all;
text-align: center;
}

HTML:

    <div>Sample Text</div>

关于javascript - 如何垂直书写/显示文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34542233/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com