<!DOCTYPE html>
<meta charset="UTF-8">
<style>
  #span-doc {
    color: green;
    background-color: greenyellow;
  }
</style>
<body>
<iframe
  id="iframe"
  srcdoc="<span id='span-iframe'>abc</span>"
  >
</iframe>
<br>
<span id="span-doc">abc</span>