是否可以更改iframe body的margin -color ?我无法改变它,因为tiny- mme -min.css来自CDN,所以如何覆盖它,或者它可以在本地加载。
我可能迟到了,但你可以通过向iframe添加样式来实现这一点。
let iframe = document.querySelector('fieldset iframe');// or use iframe id something like "selector_ifr"
let style = document.createElement('style');
style.textContent =
`
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap');
body {
background: #17191B !important;
font-family: 'Open Sans', sans-serif !important;
color: #81729A !important;
transition: all .25s !important;
}
body:focus-visible {
background: #0E0C12 !important;
}
`;
iframe.contentDocument.head.appendChild(style);
请注意,这是一个丑陋的hack