【问题标题】:Before pseudo element not working in makestyles在伪元素在makestyles中不起作用之前
【发布时间】:2021-08-21 01:22:33
【问题描述】:

我在 react 中使用 makestyles,但我无法弄清楚为什么之前的内容不会显示。如果我将内容设为图片但不显示文字,它将起作用。

进一步澄清之前元素根本没有被渲染。

cardPoint: {
    alignSelf: 'center',
    justifySelf: 'start',
    maxWidth: '250px',
    position: 'relative',
    "&:before": {
      content: 'Look at me',
      display: 'inline-block',
      color: '#000',
    },
  }

【问题讨论】:

    标签: javascript css reactjs material-ui makestyles


    【解决方案1】:

    我认为你必须将'Look at me' 传递为'"Look at me"'

    【讨论】:

      猜你喜欢
      • 2020-07-07
      • 2018-06-02
      • 1970-01-01
      • 2021-08-06
      • 1970-01-01
      • 2017-10-07
      • 2018-05-22
      • 2014-01-30
      • 1970-01-01
      相关资源
      最近更新 更多