css怎么把横着的字竖起来


本文摘自PHP中文网,作者藏色散人,侵删。

css把横着的字竖起来的实现方法:首先创建一个HTML示例文件;然后定义一个div文字;最后设置css样式为“{width: 20px;margin: 0 auto;line-height: 24px;}”即可将文字竖起来。

本教程操作环境:windows7系统、css3版,该方法适用于所有品牌电脑。

推荐:《css视频教程》

1、一个句子的竖向排列

如图:

87c67edf7e6bc39c159c84e03633165.png

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

<!DOCTYPE html> 

<html> 

<head> 

    <title>test</title> 

    <meta charset="UTF-8"

</head> 

<style> 

.one { 

    width: 20px; 

    margin: 0 auto; 

    line-height: 24px; 

    font-size: 20px;

}

.two { 

    width: 15px; 

    margin: 0 auto; 

    line-height: 24px; 

    font-size: 20px; 

    word-wrap: break-word;/*英文的时候需要加上这句,自动换行*/ 

</style> 

<body> 

    <div class="one">我是竖列排版</div> 

    <div class="two">I AM ENGLISH</div> 

</body> 

</html>

2、多个句子竖向排列(如古诗)

如图:

阅读剩余部分

相关阅读 >>

如何在css中实现并排生成多行的dt和dd

使用css怎么实现毛玻璃效果?

css border-top-color属性怎么用

css中伪类是什么

css的相邻兄弟选择器何时用

css怎么设置背景图片大小

css如何让隐藏的元素显示出来

css怎么让字体更大

css怎么实现对话框

css文本域怎么写

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




打赏

取消

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

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

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

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

评论

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