当前第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 z-index的权重问题
4个可以用来提高页面渲染速度的css技巧
css中内边框是什么
css由什么组成
css后代选择器有哪些
css如何使用important
css如何设置div字体大小
css文件中引用图片不显示怎么办
css sprite是什么
hover在css中有什么用?
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css怎么实现文字横排