javascript - 在反应中确保折叠到小屏幕上的卡片之间的空间
问题描述
我试图确保当我在小屏幕上查看我的反应网站时,我的卡片之间有空间。现在,当我在大屏幕上查看时,卡片的间距是均匀的,但是,在小屏幕上,它们不是空格。有没有人遇到过这个问题?
这是我的代码
<Row gutter={16} justify="space-between" align="middle">
{this.state.news.slice(0,4).map((item, key) => (
<Col span={12} md={{span:6}} lg={{span:6}} style={{paddingTop:15,marginTop:10}}>
<Card
hoverable
style={{ width: 230 }}
cover={<img alt="example" src={item.imageurl} />}
actions={[
<a href={item.url} target="_blank" > Read News</a>,
]}>
<div style={{fontSize:10,paddingRight:5}}>
<Meta title={item.title} description={item.categories} />
</div>
</Card>
</Col>
))}
</Row>
解决方案
你有style={{ width: 100 }}
,这将保持所有屏幕的宽度固定。拿出来试试。
<Card
hoverable
// style={{ width: 100 }}
cover={<img alt="example" src={i.picture.large} />}
actions={[
<a href='#' target="_blank" > Read News</a>,
]}>
</Card>
推荐阅读
- or-tools - VRP:可以检测具有空域的变量吗?
- javascript - JS浏览器游戏——避免初始化所有对象
- javascript - 如何在前端使角色有条件?
- javascript - 使用 jQuery 修改 DOM 元素后如何重新加载函数(tempus dominus)
- javascript - 在css中做一个下拉按钮
- node.js - 我如何测试具有本地依赖关系的 TypeORM 存储库方法
- java - Firebase DataSnapshot.getValue() 为空
- jquery - jQuery UI 自动完成包装结果
- c++ - _CrtSetAllocHook - 未处理的异常
- excel - 反向运行总计