将p的CSS样式中的display改为inline-block,然后将margin改为auto即可。

修改后的CSS样式如下:

p{ font-family:"kai ti"; font-size: 45px; font-weight: bold; color: #0033CC; text-align: center; writing-mode: vertical-rl;

display: inline-block;
/*height: 60vh;*/
margin: auto;

}

怎样在让p中的文字随着页面变化始终是居中显示!DOCTYPE htmlhtml lang=enhead meta charset=UTF-8 meta name=author content=Xue Huanqun titleTitletitle style type=textcss p font-familykai ti;

原文地址: https://www.cveoy.top/t/topic/d6EJ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录