html - 更改不同分辨率的文本大小
问题描述
我的背景随着浏览器的不同分辨率而变化。这是完美的工作。然后是js中输入的文字。我也想用不同分辨率的浏览器更改该文本的大小。
你知道怎么做吗?
小尺寸:
.wrap-hero-content {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.hero-content {
position: absolute;
text-align: center;
min-width: 110px;
left: 50%;
top: 58%;
padding: 65px;
outline-offset: 8px;
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
<div class="wrap-hero-content">
<div class="hero-content">
<span class="typed"></span>
</div>
</div>
解决方案
你将不得不使用这样的东西:
@media screen and (max-width : 320px)
{
.your_text
{
font:10px;
}
}
@media screen and (max-width : 1204px)
{
.your_text
{
font:16px;
}
}
推荐阅读
- first-order-logic - 理解描述逻辑 (DL) 中概念的普遍限制
- sql - oracle - group by - 无聚合
- mysql - 在 MySQL 中创建和添加数据到文本文件时出现问题?
- mongodb - MongoDB 在一个文档中查询聚合
- firebase - 如何检查用户是否已在 Firestore 中注册?
- postgresql - 将 PostgreSQL 从 9.5 升级到更新版本并将数据库移动到不同的机器
- javascript - GoJS 显示不正确的图表类型
- python - Python 套接字客户端仅适用于一次迭代
- junit - JUnit5 对 @Before* 方法失败做出反应
- typescript - this.connection.getMetadata 不是函数