css怎么实现文字横排


当前第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》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...