Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个宽度为 450 的 iframe,里面有文本,我想在 iframe 的右侧对齐这个文本。我无权访问 iframe 来更改它。
我无权访问 iframe 来更改它。
那我怕你想做的事情是不可能的。同源策略阻止对该iFrame 的 DOM 的任何和所有访问。
您必须使用服务器端脚本来获取 iframe 的内容。
如果是 XS (Cross-Site) 你不能这样做
这只有在您有权访问 iframe 文件时才能实现。