【问题标题】:Icon Button in React Material CardReact Material Card 中的图标按钮
【发布时间】:2020-09-27 01:56:28
【问题描述】:

我正在尝试将编辑图标按钮放在卡片的右侧。我想实现如下图所示。请查看此沙箱链接以了解我当前的输出

CLICK HERE FOR IMAGE LINK

CLICK HERE FOR SANDBOX LINK

    <CardHeader
          classes={{
            title: classes.title
          }}
          className={classes.cardHeader}
          title={"John Smith"}
          subheader={
            <h2 style={{ color: "white", textAlign: "center" }}>
              User
            </h2>
          }
        />
        <Button
          variant="contained"
          color="secondary"
          className={classes.editButton}
          startIcon={<EditIcon />}
        />

【问题讨论】:

    标签: css reactjs react-material


    【解决方案1】:

    https://codesandbox.io/s/material-demo-ghtlj?file=/demo.js

    我将按钮移动到卡片内容并为其设置绝对位置。那么parent相对定位,样式很少。

    【讨论】:

      猜你喜欢
      • 2017-08-03
      • 2021-06-15
      • 2020-04-15
      • 2021-05-14
      • 2018-12-12
      • 1970-01-01
      • 2023-01-13
      • 2019-10-19
      • 1970-01-01
      相关资源
      最近更新 更多