如何在html文件中显示txt文件的内容,并要求我可以格式化此文本?

时间:2017-10-25 09:51:42

标签: javascript jquery html css html5

我想在HTML页面中显示txt文件的内容:

<html>
<head>

    <title><div style="font-family: verdana; font-size: 50px; color: blue">
    blabla</div></title>
    <meta http-equiv="refresh" content="5">
</head>

<body>
<div style="font-family: verdana; font-size: 50px; color: blue">
    blabla</div>


    <p></p>
    <div style= "font-family: verdana; font-size: 24px; color: blue">blabla </div> 
    <object data="file:///C:/number.txt" type="text/plain" width="200" height="50"></object>
    <div style =  "font-family: verdana; font-size: 24px; color: blue"> blabla</div>

这有效,但我无法改变字体或字体颜色等内容。我尝试了div风格,我用CSS试了一下,“!important”也不是解决方案。

特定受影响的代码:

<object data="file:///C:/number.txt" type="text/plain" width="200" height="50"></object>

问:如何在我的HTML页面中导入我的txt文件的内容,条件是我不能格式化文本?

0 个答案:

没有答案