uni-app:文字竖直排列,并且在父级view中水平竖直对齐

一、效果

二、代码

html 复制代码
<template>
	<view class="parent">
	  <text class="child">这是竖直排列的文字</text>
	</view>
</template>
<script>
	export default {
		data() {
			return {

			}
		},
		methods: {

		},
	};
</script>
<style>
	.parent {
	  display: flex;
	  align-items: center; /* 竖直居中 */
	  justify-content: center; /* 水平居中 */
	  height: 500px; /* 父级高度设为100%,或指定一个固定高度 */
	  border:1px solid black;
	}
	.child {
	  writing-mode: vertical-rl; /* 文字竖直排列,从右向左 */
	  text-orientation: upright; /* 文字保持正常方向 */
	  border:1px solid red;
	}
</style>
相关推荐
kyriewen111 天前
你点的“刷新”是假刷新?前端路由的瞒天过海术
开发语言·前端·javascript·ecmascript·html5
Timer@1 天前
LangChain 教程 04|Agent 详解:让 AI 学会“自己干活“
javascript·人工智能·langchain
阿珊和她的猫1 天前
TypeScript中的never类型: 深入理解never类型的使用场景和特点
javascript·typescript·状态模式
skywalk81631 天前
Kotti Next的tinyfrontend前端模仿Kotti 首页布局还是不太好看,感觉比Kotti差一点
前端
RopenYuan1 天前
FastAPI -API Router的应用
前端·网络·python
走粥1 天前
clsx和twMerge解决CSS类名冲突问题
前端·css
Purgatory0011 天前
layui select重新渲染
前端·layui
weixin199701080161 天前
《中国供应商商品详情页前端性能优化实战》
前端·性能优化
九皇叔叔1 天前
003-SpringSecurity-Demo 统一响应类
java·javascript·spring·springsecurity