当前位置:网站首页>如何在 WordPress 中嵌入 iFrame
如何在 WordPress 中嵌入 iFrame
2022-06-29 15:37:00 【华为云】
Iframe 是一种将网页嵌入到另一个页面的内容中的方法。这是通过使用 HTML 元素、外部网站的 URL 以及窗口在您的网站上的外观参数来实现的。
如何在 WordPress 中使用 iframe:构建 iframe 的方法有多种,就像您希望在许多实例中使用其中一种一样。我们将通过一种最常见的方式将 iframe 添加到您的 WordPress 网站。
手动将 iFrame 添加到 WordPress 页面:
将 iframe 添加到页面只需要一行代码。需要打开和关闭 HTML 元素以及网页的 URL。
语法:
<iframe src="example.com"></iframe>嵌入 WordPress 页面的步骤:
第 1 步:转到您希望 iframe 出现的页面。

第 2 步:单击添加(+)块按钮并从弹出窗口中选择 HTML。

第 3 步:在要嵌入的页面的编辑器中插入 iframe 标记。

注意:需要注意源 URL 的一些限制。首先,iframe 可能只显示来自与您使用相同超文本传输协议 (HTTP) 的网站的内容。换句话说,如果您的站点是 HTTPS,则您只能嵌入来自其他 HTTPS 站点的信息。同样,如果您使用 HTTP,则您可能只包含使用 HTTP 的 URL。
第 4 步:要保存进度并发布页面,请单击“发布”按钮。

第 5 步。您的页面现在应该类似于以下屏幕。

有关 iframe 标记的更多信息:
如果您能够采用此策略,请记住您也可以更改您的 iframe 以适应您网站的需求。Iframe 参数开始发挥作用。以下是一些最常见的。
- Allow:使用此参数,您可以指定您的 iframe 是否应具有某些默认行为或功能。
- 高度:高度参数设置网页上 Iframe 窗口的像素大小。
- 宽度:此选项允许您选择 Iframe 的宽度(以像素为单位)。
例如,窗口大小为 1080 x 720 像素,启用全屏查看并设置为在网页其余部分后下载的 iframe 如下所示。
<iframe src="https://example.com" width="1080" height="720" allow="fullscreen"></iframe>摘要:保持您的网站顺利运行,同时仍然遵守法律,这一点至关重要。Iframe 不仅允许您以合乎道德的方式分享他人的材料,而且还允许您显示视频和音频文件,而无需将它们存储在您自己的网站上。
边栏推荐
- When easygbs calls the interface for obtaining real-time snapshots, how to solve the problem of white squares?
- PostgreSQL source code learning (23) -- transaction log ④ - log assembly
- 为Golang项目编写Makefile
- Several imaging modes of polarimetric SAR
- leetcode:139. 单词拆分【dfs + memory】
- Taro中添加小程序 “lazyCodeLoading“: “requiredComponents“,
- 墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG资料124篇)
- 路由汇总带来的三层环路-解决实验
- Leetcode-64- minimum path sum
- Mysql database naming conventions PDF
猜你喜欢
随机推荐
Kotlin annotation Statement and use
C#学习一:值类型与引用类型
C # learning 1: value type and reference type
绑定证券账户到同花顺安全吗?哪家券商开户后可以绑定同花顺
A. Print a Pedestal (Codeforces logo?)
It is expected to significantly improve the computational performance of integrated photonic circuits. The Tsinghua team proposed a diffraction pattern neural network framework
When easygbs calls the interface for obtaining real-time snapshots, how to solve the problem of white squares?
radar transmitter
Three development trends of enterprise application viewed from the third technological revolution
如何用好数据科学?
taro3.*中使用 dva 入门级别的哦
swoole TCP 分布式实现
12.udp protocol -bite
stlink故障修复
《网络是怎么样连接的》读书笔记 - 服务器端的局域网中(四)
What are the advantages of intelligent chat robots? Senior independent station sellers tell you!
To prevent enterprise data leakage, use the fortress machine of network security products!
STM32与GD32笔记
华为云AOM 2.0版本发布
About sql+nosql: newsql database









