Is it somehow possible to style an iframes before/after pseudo-element?

前端 未结 2 1718
醉话见心
醉话见心 2021-02-18 20:32

As the title says, is there a way to style an iframes pseudo before/after? Without wrapping the iframe with another div, or else?`

2条回答
  •  情话喂你
    2021-02-18 21:06

    I am not sure but I think it isn't possible. Or the logic behind an iframe makes it imposible to achieve.

    As you know, pseudo-elements are added to its container, if you do that with an iframe, pseudo-elements would be added inside the iframe. But, and here's the problem, the iframe content, the inline content, will just load if the browser doesn't support iframes.

    This means that this:

    
    

    And adding pseudo-elements, will do the same thing; on modern browsers inline content wouldn't be displayed.

提交回复
热议问题