且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将div扩展到iFrame的边界之外?

更新时间:2023-02-02 07:50:23

No. There is no way to extend content outside of an iframe. Think of it as another browser window entirely.

The reason that the options will extend below the iframe is that form elements follow their own rules. They differ from browser to browser, and for some of the elements you can't change the styling. When you use select2 it turns the form into a regular element (not a default form element), so you can manipulate the style. Unfortunately, this also makes it confine to the iframe.

Consider that a browser can also do this (but it doesn't mean you can):