html - 使用 flex 时,铬合金中会出现左侧填充;但不是在Firefox中
问题描述
我使用 Manjaro 作为操作系统,所以我不了解 Chrome。我有这个问题,使用 flexbox 后左侧出现填充,这个问题只发生在 Chromium 中,而不发生在 Firefox 中。
我不知道问题出在哪里(因为除了可访问性和响应性之外,我不知道代码是否有任何问题,但这是因为我还没有完成编码)
这是我的html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./images/favicon-32x32.png"
/>
<link rel="stylesheet" href="./styles.css" />
<title>Frontend Mentor | Stats preview card component</title>
</head>
<body>
<main class="container">
<div class="hero-image">
<img src="./images/image-header-desktop.jpg" alt="" srcset="" />
</div>
<div class="content">
<div class="main-header">
Get <span>insights</span> that help your business grow.
</div>
<div>
Discover the benefits of data analytics and make better decisions
regarding revenue, customer experience, and overall efficiency.
</div>
<div>
<div>
<div>10k+</div>
<div>companies</div>
</div>
<div>
<div>314</div>
<div>templates</div>
</div>
<div>
<div>12m+</div>
<div>queries</div>
</div>
</div>
</div>
</main>
</body>
</html>
这是CSS
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Lexend+Deca&display=swap");
* {
margin: 0;
padding: 0;
}
body {
background-color: hsl(233, 47%, 7%);
font-size: 15px;
}
.container {
background-color: hsl(244, 38%, 16%);
display: flex;
flex-direction: row-reverse;
}
.main-header {
font-family: "Inter", sans-serif;
font-weight: 700;
}
span {
color: hsl(277, 64%, 61%);
}
.attribution {
font-size: 11px;
text-align: center;
}
.attribution a {
color: hsl(228, 45%, 44%);
}
ps:这是frontendMentor的挑战!
解决方案
推荐阅读
- python-3.x - discord.py 一些任务没有工作 [AttributeError: 'NoneType' object has no attribute 'send']
- python - 优化 Python/C++ 算法
- arrays - 用户按 ENTER 后如何停止接受输入?C 编程语言
- python - 如何阻止我的 python 脚本变得无响应?
- arrays - 将结构转换为字节数组并返回 rust
- microsoft-teams - MS Teams 传出 Webhook 没有提及可能吗?
- heroku - Heroku:ModuleNotFoundError:没有命名的模块
- javascript - 如何从 W2UI 网格工具栏中删除搜索和刷新字段?
- flutter - 如何在颤动中映射或索引到图像和音频?
- javascript - node.js mysql - 以 YYYY-MM-DDThh:mm:ssZ 格式提取日期时间,无需毫秒