html - 如何在 iframe 中更改 txt 文件的样式

标签 html css iframe

在过去的几天里,我遇到了一个问题,我的网站上有一个这样的 iframe:

<iframe src ="http://hokuco.com/cde/user.txt" id ="myIframe"></iframe>

但是,consolas 看起来太旧了,使我的网站看起来像 80 年代的计算机终端。我试过在 iframe 周围使用字体标签,也试过更改字体类型,有什么方法可以将 iframe 文本从 consolas 更改为 arial?

最佳答案

使用 PHP:

PHP

<p><?php echo file_get_contents('http://hokuco.com/cde/user.txt'); ?></p>

使用 JQuery:

HTML:

<p id="text"></p>

JQuery:

$('#text').load("http://hokuco.com/cde/user.txt");

关于html - 如何在 iframe 中更改 txt 文件的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35102784/

相关文章:

css - 删除博客中的自动调整大小

html - 如何在 Bootstrap 表中的 <span> 内换行或换行

security - IE 11 第一方 session cookie 在 iframe 中丢失

javascript - `base` 标记导致 iframe 在 Internet Explorer 中作为新窗口打开

html - 如何从sql文本字段中获取带有html标签的 "grep"行?

javascript - 在 contenteditable div 中获取子 div 的 id

html - 移动兼容 map 标记

javascript - Firefox 在错误的位置显示插入符号?

html - CSS 内联画廊/最大宽度 : 100% = Scrollbar does not appear

html - 一起使用 "transform"和 "table"