在谷歌浏览器里面,字体最小只能设置为12px,但是我们有时候需要展示更小的文字。方法如下:
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Auto Scroll</title><style>.small_word {font-size: 16px;transform: scale(0.5); /* 将文字缩小至8px大小效果 */transform-origin: left top;}</style>
</head><body><div class="small_word">小号文字</div>
</body></html>
这个方法是通过缩放来做的,就那8px举例,首先设置文字大小为16px,然后缩小一半,就达到了8px的效果,然后看以哪个位置为原点进行缩放。