html - 有谁知道为什么我的缩略图没有显示?
问题描述
我似乎无法弄清楚我做错了什么,我的缩略图没有显示。我知道这可能是非常基本的,但我只是一个初学者,我不断删除和更改代码中的内容,我仍然不明白为什么它不会显示。感谢您抽出宝贵时间,这是我的代码:
h1,
p {
font-family: Arial, Helvetica, sans-serif;
font-weight: 100;
font-size: 2vw;
}
.container {
max-width: 960px;
width: 90%;
margin: 0 auto;
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-gap: 8px;
}
max-width: 960px;
width: 90%;
margin: 0 auto;
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-gap: 8px;
}
.box img {
border: 1px solid #ccc;
box-shadow: 2px 2px 6px 0px rgba(0, 0, 0, 0.3);
max-width: 100%;
background-color: cornflowerblue;
}
img {
border: 1px solid #ddd;
border-radius: 10px;
padding: 5px;
width: 150px;
}
img:hover {
box-shadow: 0 0 2px 1px rgba(0, 139, 186, 0.815);
}
@media screen and (max-width: 1024px) {
.container {
grid-template-columns: repeat(3, 1fr);
}
}
@media screen and (max-width: 768px) {
.container {
grid-template-columns: repeat(2, 1fr);
}
}
@media screen and (max-width: 414px) {
.container {
grid-template-columns: repeat(1, 1fr);
}
}
<body>
<h1>Gallery heading</h1>
<div class="container">
<div class="box"> <img src="placeholder-image.png" alt=""></div>
<div class="box"> <img src="placeholder-image.png" alt=""></div>
<div class="box"> <img src="placeholder-image.png" alt=""></div>
</div>
<p>.</p>
</body>
</main>
解决方案
推荐阅读
- c++ - 如何从二进制文件中读取数据并推回向量?
- android - 总能找到手机状态接收变化
- javascript - 如何将索引从li传递到axios?
- react-native - React Native 自定义密码屏幕
- python - 如果我在列表中输入一个元素,如何打印该列表的下一个元素?
- visual-studio-code - VS Code Extension:是否可以使用 JS 访问 View 项目?
- c++ - 无符号整数的有效比较(C++ 编译器优化)
- ios - 在 Mac 上安装 idb iOS 笔测试工具时出错
- javascript - 创建一个基于 props 更改其类型并支持所有输入类型的单个输入组件是否可行?或者组件会变得复杂吗
- django - React 和 Django Nginx 在页面刷新时给出 404 not found 错误