当前第2页 返回上一页
html:
1 2 3 4 | <p class = "textBox" >
<h1>horizontal-tb:横向排列</h1>
<h1>vertical-rl:纵向排列,从右到左</h1>
<h1>vertical-lr:纵向排列,从左到右</h1></p>
|
css:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <style>
.textBox h1{
width: 200px;
height: 200px;
margin: 10px 10px;
padding: 10px;
float: left;
}
.textBox h1:nth-of-type(1){
writing-mode: horizontal-tb;
background-color: #42b983;
}
.textBox h1:nth-of-type(2){
writing-mode: vertical-rl;
background-color: #42a8b9;
}
.textBox h1:nth-of-type(3){
writing-mode: vertical-lr;
background-color: #81b9aa;
}
</style>
|
实现效果:

推荐学习:《css视频教程》
以上就是css怎么实现文字横排的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
css如何修改字体大小
css margin-top属性怎么用
css modules是啥子东西?一起来了解一下!
css中字体常用单位有哪些?
css nav 是什么意思
css怎么让元素超出父元素
css 括号是什么
css怎么把纵向排列变成横向
css怎么实现阴影效果
js和css文件位置对页面性能有什么影响?
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css怎么实现文字横排