jquery - 使用背景图像制作链接列表 1 行桌面,同一设备上的两列
问题描述
我有一个生成的 Instagram 提要links
。我想保留1 column
在桌面和其他设备(平板电脑、桌面)上2 column
。我可以使用bootstrap,问题是html
结构是之后生成的,所以我不能row
在两个项目之间做一个两列(只显示第一个项目结构)。你可以在这里看到一个活生生的例子。现在它在移动设备上以这种方式显示但无序:
HTML结构:
<div class="container-fluid mx-auto insta-feed">
<h2>INSTAGRAM</h2>
<div id="instafeed">
</div>
</div>
JS
var userFeed = new Instafeed({
get: 'user',
userId: '5388417298',
accessToken: '5388417298.1677ed0.e3460b92c6f445c98d18f18635f740cf',
template: '<a href="{{link}}" class="in-img" target="_blank" id="{{id}}" style="background-image: url({{image}});"></a>',
sortBy: 'most-recent',
limit: 4,
resolution: 'standard_resolution',
});
userFeed.run();
CSS
#instafeed a:last-child {
margin-right: 0px;
}
#instafeed {
text-align: center;
}
#instafeed a {
height: 210px;
margin-top: 10px;
width: 210px;
display: inline-block;
margin-right: 40px;
object-fit: cover;
background-size: cover;
}
@media screen and (max-width: 576px) {
#instafeed a {
height: 120px;
width: 120px;
margin-right: 20px;
}
}
解决方案
推荐阅读
- elasticsearch - elasticsearch中关键字类型为文本时如何使用term查询
- android - 如何动态更改依赖项?
- .net - Grafana PromQL 无法读取未定义的属性“结果”
- flutter - 自定义原材料按钮 - Flutter
- angular - 尝试 npm install 时标签名称“file-saver@2.0.1”无效
- angular - RXJS 和 typescript:有条件地使用服务器和客户端代码执行工作
- c# - 如何在 ASP.NET Core 中为 React SPA 自定义身份控制器?
- java - 获取与文件 java 关联的应用程序
- spring-boot - Spring Boot application.properties 无法从另一个属性文件中获取值
- node.js - 多个 node_modules 目录