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 z-index的权重问题

4个可以用来提高页面渲染速度的css技巧

css中内边框是什么

css由什么组成

css后代选择器有哪些

css如何使用important

css如何设置div字体大小

css文件中引用图片不显示怎么办

css sprite是什么

hover在css中有什么用?

更多相关阅读请进入《css》频道 >>




打赏

取消

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

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

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

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

评论

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