美文网首页
多行文字垂直居中,超出隐藏

多行文字垂直居中,超出隐藏

作者: 造轮子的蜗牛 | 来源:发表于2019-11-26 18:10 被阅读0次
image.png
    max-height: 3.6rem;  //最大高度限制2行
    display: inline-block;
    overflow: hidden;
    position: absolute;
    text-align: center;
    width: 8rem;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);//利用自身宽高居中

相关文章

  • 多行文字垂直居中,超出隐藏

  • css居中各种实现

    垂直居中 多行文字垂直居中 利用flex布局 利用display: table;

  • 多行文字的水平垂直居中

    单行文字垂直居中 知道容器的高度即可 html css 多行文字垂直居中 html css 多行文本溢出用省略号表...

  • 普通的css样式技巧

    垂直居中 1、多行文字垂直居中 给文字容器的父容器设定display:table,给文字容器设定vertical-...

  • 大小不固定的图片和多行文字的垂直水平居中

    大小不固定的图片和多行文字的垂直水平居中一、大小不固定,多行文字的垂直居中① 单行文字可能很多人都知道如何让单行文...

  • 布局(一)display:table-cell

    html: css: 1)单行文字垂直居中 2)多行文字居中 3)容器居中 1 2 下面简述一下display:t...

  • 多行文字垂直居中

    前几天一个同事告诉我margin: auto;可以垂直居中,我惊愕:“怎么会?margin: auto不是只能水平...

  • 多行文字垂直居中

    CSS中的vertical-align属性只会对拥有valign特性的(X)HTML标签起作用,但是在CSS中还有...

  • CSS-Tricks (一)

    1. 在一行中,如何让文字垂直居中? demo在这里 2. 超出内容用省略号显示 多行 demo在这里 单行 de...

  • css篇

    文字在页面中居中 非固定高度在父元素中居中 文字单行隐藏 文字多行隐藏 x轴滑动查看 h5页面在iphone下滑动...

网友评论

      本文标题:多行文字垂直居中,超出隐藏

      本文链接:https://www.haomeiwen.com/subject/bxeywctx.html