博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
文本内容不管有多少始终能垂直居中:
阅读量:7136 次
发布时间:2019-06-28

本文共 436 字,大约阅读时间需要 1 分钟。

hot3.png

html文件:

<div  class = "parent">

        <div class = "left"></div>

       <div class = "right">

               <div class = "son">

                       <div class="content">一行我要垂直居中,两行三行我也要垂直居中</div>

               </div>

      </div>

</div>

css文件:

.right{

width:100%;

height:2rem;

}

.son{

width:100%;

height:2rem;

display: table;

.content{

width:100%;

height:2rem;

display: table-cell;

vertical-align: middle;

word-wrap: break-word;

word-break: break-all;

 

转载于:https://my.oschina.net/u/2947900/blog/831887

你可能感兴趣的文章
栅格系统
查看>>
[Selenium] 使用自定义的FirefoxProfile
查看>>
Spine批量导出Command line Export
查看>>
POJ3690:Constellations——题解
查看>>
第二次毕业设计任务书
查看>>
Maven中POM.XML详解
查看>>
小时候,长大了
查看>>
一次服务器被入侵后的分析
查看>>
Ubuntu sudo 出现 is not in the sudoers file解决方案
查看>>
转 Linux文件管理
查看>>
Android中资源文件assets和res下面raw文件的使用不同点
查看>>
汉子字符转换成大写英文字母开头。。
查看>>
SQL优化(数据库的优化)
查看>>
android学习摘记——关于android ListView的美化
查看>>
Python--day72--ajax简介
查看>>
初识Python(windows)——下载、安装、使用
查看>>
NetCore Tag Helpers 和 HTML Helpers 和 Web 服务器控件比较
查看>>
Hadoop常用命令
查看>>
vue-cli 脚手架项目简介(一) - package.json
查看>>
js的数据类型及类型转换
查看>>