我想在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文件的内容,条件是我不能格式化文本?