【问题标题】:Customize CSS Styles on Iframe in React在 React 中自定义 iframe 上的 CSS 样式
【发布时间】:2021-08-31 04:49:22
【问题描述】:

我需要设置网站 iframe 的 CSS 样式。您如何自定义它,例如隐藏导航菜单?我正在使用样式组件并做出反应。

在此处检查我的代码框 CLICK HERE

const FormContainer = styled.div`
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: scroll;

  & iframe {
    & #page-header-container {
      display: none !important;
    }
  }
`;

【问题讨论】:

    标签: css reactjs iframe styled-components


    【解决方案1】:

    您不能从父元素修改iframe 样式。由于浏览器的安全问题,不允许这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-09
      • 2021-12-31
      • 2021-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-19
      • 2022-01-26
      相关资源
      最近更新 更多