|
楼主 |
发表于 2019-2-3 10:57:32
|
显示全部楼层
本帖最后由 williamso 于 2019-2-3 11:03 编辑
开始 保存 txt ,转换 html 格式 ( 是不是 格式的问题 TXT 转换 HTML )
***************************************第 13 行 / 第 14行 保存 html 后 变成 短短的的这几行 图1
< pre clsaa="prettyprint hljs-dark"><code class="hljs xml"><div class="codeLine"><span class="hljs-meta"><,!DOCTYPE html></span></div><div class="codeLine"><span class="codeTag"><...................
</pre>
*************************保存 txt 前 一大段
<!DOCTYPE html>
<html>
<head><title>课后作业</title>
<meta charset='utf-8'>
<link rel="stylesheet" href="css/fishc.css">
<style>
.note-content {
font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", STHeiti, "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, Song, sans-serif;
}
</style>
</head>
<body>
<div id='preview-contents' class='note-content'>
<pre class="prettyprint hljs-dark"><code class="hljs xml"><div class="codeLine"><span class="hljs-meta"><!DOCTYPE html></span></div><div class="codeLine"><span class="codeTag"><<span class="codeName">html</span> <span class="hljs-attr">lang</span>=<span class="codeAttrValue">"en"</span>></span></div><div class="codeLine"><span class="codeTag"><<span class="codeName">head</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">meta</span> <span class="hljs-attr">charset</span>=<span class="codeAttrValue">"UTF-8"</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">meta</span> <span class="hljs-attr">name</span>=<span class="codeAttrValue">"viewport"</span> <span class="hljs-attr">content</span>=<span class="codeAttrValue">"width=device-width, initial-scale=1.0"</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">meta</span> <span class="hljs-attr">name</span>=<span class="codeAttrValue">"keywords"</span> <span class="hljs-attr">content</span>=<span class="codeAttrValue">"小甲鱼,Web开发,HTML5,CSS3,Web编程教学"</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">meta</span> <span class="hljs-attr">name</span>=<span class="codeAttrValue">"description"</span> <span class="hljs-attr">content</span>=<span class="codeAttrValue">"《零基础入门学习Web开发》课后作业"</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">meta</span> <span class="hljs-attr">name</span>=<span class="codeAttrValue">"author"</span> <span class="hljs-attr">content</span>=<span class="codeAttrValue">"鱼C工作室"</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">title</span>></span>课后作业<span class="codeTag"></<span class="codeName">title</span>></span></div><div class="codeLine"> <span class="codeTag"></<span class="codeName">head</span>></span></div><div class="codeLine"><span class="codeTag"><<span class="codeName">body</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">p</span>></span>你最喜欢吃的水果是:<span class="codeTag"><<span class="codeName">span</span> <span class="hljs-attr">id</span>=<span class="codeAttrValue">"fruit"</span>></span> <span class="codeTag"></<span class="codeName">span</span>></span><span class="codeTag"></<span class="codeName">p</span>></span></div><div class="codeLine"> <span class="codeTag"><<span class="codeName">script</span>></span><span class="javascript"></span></div><div class="codeLine"><span class="javascript"> <span class="hljs-keyword">var</span> user_input = prompt(<span class="codeAttrValue">"你最喜欢吃的水果是:"</span>);</span></div><div class="codeLine"><span class="javascript"> <span class="hljs-built_in">document</span>.getElementById(<span class="codeAttrValue">"fruit"</span>).innerHTML = user_input;</span></div><div class="codeLine"><span class="javascript"></span> <span class="codeTag"></<span class="codeName">script</span>></span></div><div class="codeLine"><span class="codeTag"></<span class="codeName">body</span>></span></div><div class="codeLine"><span class="codeTag"></<span class="codeName">html</span>></span></div></code>
</pre>
</div>
</body>
</html>
|
|