Положение iframe: исправлено не работает, когда я добавляю css в iframe - PullRequest
1 голос
/ 18 июня 2020

Я хочу реализовать iframe, но он не может работать с приведенным ниже кодом:

<html>

<head>
  <style>
    html {
      background: green;
    }
  </style>
</head>

<body>
  <p>Hello</p>
  <iframe src="xxxxxxxxxxxxxxxxxxxx.html" position="fixed" right="60" bottom="60"
    background="transparent" marginwidth="0" marginheight="0" frameborder="0" style="border:none;"></iframe>
</body>

</html>

iframe показать, но он не работает position='fixed' и background='transparent'.

1 Ответ

1 голос
/ 18 июня 2020

Попробуйте использовать значения атрибута style, например

<html>

<head>
  <style>
    html {
      background: green;
    }
  </style>
</head>

<body>
  <p>Hello</p>
  <iframe src="xxxxxxxxxxxxxxxxxxxx.html" marginwidth="0" marginheight="0" frameborder="0" style="border:none; position:fixed; right:60px; bottom:60px; background:transparent;"></iframe>
</body>

</html>

Надеюсь, это сработает.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...