gpt4 book ai didi

reactjs - Antd - 有没有办法改变卡片标题的背景颜色?

转载 作者:行者123 更新时间:2023-12-03 14:04:20 27 4
gpt4 key购买 nike

通过添加 style 属性,我只能更改 Card 组件主体部分的颜色。我怎样才能更改标题部分?

<Card title='Card title' bordered loading={this.onLoading()}
style={{ backgroundColor: '#aaaaaa' }}>
<Row type='flex' justify='center'>
<h1>Card content</h1>
</Row>
</Card>

enter image description here

最佳答案

以下内容对我有用。我必须删除整个卡片的背景颜色,并为头部和正文内容设置不同的背景颜色:

<Card
title="Track title"
style={{backgroundColor: 'rgba(255, 255, 255, 0.0)', border: 0 }}
headStyle={{backgroundColor: 'rgba(255, 255, 255, 0.4)', border: 0 }}
bodyStyle={{backgroundColor: 'rgba(255, 0, 0, 0.4)', border: 0 }}
>
<Card.Meta
description="Track author"
/>
</Card>

结果:

Result after applying 3 styles

希望对你有帮助!

关于reactjs - Antd - 有没有办法改变卡片标题的背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44511421/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com