javascript - 在像 iframe 这样的 div 中加载整个 html
问题描述
我需要在 div 中显示一个 html 页面,例如具有滚动功能的 iframe。
<div [innerHtml]="safeHtmlContent | safehtml" style='overflow:auto;
white-space: nowrap; position: static;
width:500px;height:550px;'>here is some text</div>
它可以加载 html 内容,但问题是内容未对齐,并且 html 页面的粘性标题替换了我的标题。
那么如何才能仅在 div 中加载 html 内容。
我的示例 html 内容:
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/QAPage" class="html__responsive">
<head>
<title>angular - Angular4 Load external html page in a div - Stack Overflow</title>
<link rel="shortcut icon" href="https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d">
<link rel="apple-touch-icon image_src" href="https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a">
<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0"> ......
提前致谢。
解决方案
推荐阅读
- c++ - 为什么互斥引用上的 lock_guard 会产生 C26110
- python - 是否有python函数可以在部分已知的字符串中查找未知值?
- json - 从活动响应 Azure 数据工厂设置变量
- python - 将未定义的列表合并为一个列表
- apache-spark - Oracle“更改会话集版本..”似乎无法使用选项 sessionInitStatement
- c# - MeshGeometry3D 上的默认纹理坐标
- haskell - 在 Haskell 中的 String 中的任意位置将双空格转换为单空格
- javascript - 如何将输入文本传递给我的 React 应用程序中的过滤器组件
- php - 学说:检查鉴别器实体是否存在关系
- c++ - 建议将 std::execution 和 OpenMP 结合起来吗?