转换的替代方案:在div上缩放?

时间:2018-07-10 17:06:32

标签: html css transform scale

我有这个div:

<div class="mycontainer" 
     style="height: 50vh; width: 50vw; display: flex; align-items: center; 
     justify-content: center; overflow: visible" > 
    This is a very long text 
    this is a very long text 
    this is a very long text 
    this is a very long text
    this is a very long text
    this is a very long text
</div>

现在,我想做一个效果,将div缩小为高度为35px和宽度为35px的正方形。显然,我可以手动设置div的高度和宽度,但是文本内的内容不会沿着div缩小/缩放。我考虑使用transform: scale,但是随着我从50vh和50vw缩小到35px,我不知道要使用的确切比例数字。该语法也不起作用:transform: scale(calc(80vw / 35px), calc(80vw / 35px))。我该怎么办?

0 个答案:

没有答案