Html iframe之前的分页符
我有一个包含以下内容的React页面:Html iframe之前的分页符,html,css,reactjs,iframe,printing,Html,Css,Reactjs,Iframe,Printing,我有一个包含以下内容的React页面: <p>Some text content</p> <div><iframe /></div> <!--large html content inside iframe--> 但它不起作用。我做错什么了吗?有什么办法可以避免这种分页符吗 我在这里发现了类似的问题,但没有答案。尝试在分区上添加边距。边距0或在顶部添加一些负值 div { @media print { iframe
<p>Some text content</p>
<div><iframe /></div> <!--large html content inside iframe-->
但它不起作用。我做错什么了吗?有什么办法可以避免这种分页符吗
我在这里发现了类似的问题,但没有答案。尝试在分区上添加边距。边距0或在顶部添加一些负值
div {
@media print {
iframe {
break-before: avoid;
}
}
}