Home >Web Front-end >CSS Tutorial >How to make words write vertically in css

How to make words write vertically in css

coldplay.xixi
coldplay.xixiOriginal
2021-03-12 15:44:215158browse

How to write vertically in css: Use [writing-mode] to set the writing direction of the object. The syntax is [writing-mode: lr-tb, tb-rl], where [lr-tb] is from Left to right, from top to bottom, [tb-rl] from top to bottom, from right to left.

How to make words write vertically in css

The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.

How to write vertically in css:

<strong>writing-mode</strong>(Set the writing direction of the object)

Syntax:

writing-mode : lr-tb、tb-rl

Parameters:

  • lr-tb: left to right, top to bottom

  • tb-rl: from top to bottom, from right to left

css code:

div { writing-mode: tb-rl; }

Example:

<!DOCTYPE html>    
<html>    
<head>    
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />    
<title>竖列排版实例</title>    
<style>    
div { writing-mode: tb-rl; }  
</style>    
</head>    
<body>   
<div>我是竖列排版</div>   
</body>    
</html>

Effect Picture:

How to make words write vertically in css

Related tutorial recommendations: CSS video tutorial

The above is the detailed content of How to make words write vertically in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn