CSS动态字体大小和位置边框文字

问题描述

嗨,有一种方法可以动态调整字体样式和字体位置

enter image description here

以便当将图像调整大小到任何视口时,设计和图像与字体的比例保持相同吗?

解决方法

是的。

  <your div>{
      font-size : 2vw;
    }
    img{
      height : 10vh;
      width : 12vw;
    }

这里vw表示视口宽度,而vh表示视口高度在调整窗口大小时会放大或缩小。字体大小将与图像宽度保持恒定比例。

,

是的,您可以使用CSS单位的relative lengths

示例:

<div style="font-size: 3vw;">
  This text size is according to the device screen width and this is done by CSS
</div>

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...