jquery - 将 CSS 添加到 iframe 的正文中
问题描述
我已将以下 css 添加到 IFrame 的主体但它不起作用,我也尝试使用 jQuery 但没有成功。
发现不能跨域添加,找到了解决方案,但是没用
这是我尝试过的代码
.cal iframe html body {
overflow:hidden;
}
这是我尝试使用 JQUery 的代码
$("#myiFrame").on("load", function() {
let body = $("#myiFrame").contents().find("body");
let css = '<style>/********* Put your styles here **********</style>';
$(body).append(css);
});
解决方案
推荐阅读
- julia - 读取 .osm.pbf 或将 .osm.pbf 转换为 .osm
- python - 使用 WSGI-Mod 托管在 Ubuntu-Apache 上的 Python Flask 应用程序上的 FileNotFoundError
- activemq-artemis - Artemis 联邦优先级调整是如何工作的?
- python - 双下划线文本 Tkinter
- java - What is the elegant way to parse a map into an object?
- html - How to remove an outline from a selected Card Bootstrap 5
- ruby-on-rails - Rails: Belongs_to and Has_many associations in Rails Engines
- php - How to use a function with several arguments without defining them in advance, with PHP?
- c++ - Problem moving vertex on Arrangement using Arrangement_accessor
- python - Django 序列化程序不会保存到数据库