我正在使用 React-Toolbox,在这种情况下,我怎样才能让这些 Card 元素水平对齐,彼此相邻。我试过display: inline-block
了,它把它们分成三张单独的卡片,这是我最终想要的,但它并没有将它们彼此对齐。
import { Card, CardText } from "react-toolbox/lib/card";
const ThemedCard = ({
className,
bodyTitle,
bodyText = "",
pageColor,
actions = {}
}) => {
return (
<div>
<TextBlock
style={{
padding: "1rem 0 3rem",
fontSize: "3.5rem"
}}
component={Text}
>
{bodyText}
</TextBlock>
<h2>{bodyText}</h2>
<Card
{...{ className }}
style={{ width: "350px", display: "inline-block" }}
>
<CardText>
{bodyTitle ? <Title>{bodyTitle}</Title> : null}
{objectToArray(actions).map(action => {
return (
<div>
<ButtonLink {...action} to={urlResolver(action.to)} />
<br />
<br />
</div>
);
})}
</CardText>
</Card>
<Card
{...{ className }}
style={{ width: "350px", display: "inline-block" }}
>
<CardText>
{bodyTitle ? <Title>{bodyTitle}</Title> : null}
{objectToArray(actions).map(action => {
return (
<div>
<ButtonLink {...action} to={urlResolver(action.to)} />
<br />
<br />
</div>
);
})}
</CardText>
</Card>
<Card
{...{ className }}
style={{ width: "350px", display: "inline-block" }}
>
<CardText>
{bodyTitle ? <Title>{bodyTitle}</Title> : null}
{objectToArray(actions).map(action => {
return (
<div>
<ButtonLink {...action} to={urlResolver(action.to)} />
<br />
<br />
</div>
);
})}
</CardText>
</Card>
</div>
);
};