如何根据php中header的长度缩小字体大小?

How to reduce the font size according to the length of the header in php?

我创建了一个表格,在 page.if 的开头显示 header header 的长度较大,它显示两行并且看起来很糟糕,所以请告诉我有没有办法根据 header.

的长度减小字体大小

第一种方法:你可以使用media-queries

@media screen and (max-device-width : 320px)
{
  body or yourdiv element
  {
    font:<size>px/em/cm;
  }
}
@media screen and (max-device-width : 1204px)
{
  body or yourdiv element
  {
    font:<size>px/em/cm;
  }
}

第二种方法 : 可以根据屏幕大小手动给screen.Just看看不同的屏幕大小再手动添加字体大小

那么,可以用em或者%。此外,CSS3 有一些新值用于根据当前视口大小调整事物的大小:vwvhvmin。请参阅 link

我觉得你可以在font-size中使用"em" (font-size: 1.1em) 或者percentage(font-size: 20%)。但我认为您应该分享您的屏幕截图,以便更清楚地了解问题