从这儿初始:怎么样创建一个非常简单的HTML文档?
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">重视</span>:本专栏内的教程适用于0<span style="color: black;">基本</span>的新手。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">什么是HTML?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">按照</span><a style="color: black;">百度百科</a>上的解释:HTML<span style="color: black;">叫作</span>为超文本标记语言,是一种标识性的语言。它<span style="color: black;">包含</span>一系列标签.<span style="color: black;">经过</span>这些标签<span style="color: black;">能够</span>将网络上的文档格式统一,使分散的Internet资源连接为一个<span style="color: black;">规律</span>整体。HTML文本<span style="color: black;">是由于</span>HTML命令<span style="color: black;">构成</span>的描述性文本,HTML命令<span style="color: black;">能够</span>说明文字,图形、动画、声音、表格、链接等。它的全<span style="color: black;">叫作</span>是Hyper Text Markup Language。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">简单<span style="color: black;">来讲</span>,HTML是编写网页的语言,用来告诉浏览器应该<span style="color: black;">怎样</span><span style="color: black;">表示</span>网页。HTML的编程环境不算太苛刻,大<span style="color: black;">都数</span>能编辑.txt后缀文件的软件,就<span style="color: black;">能够</span>编写HTML代码,例如Windows的记事本。只是<span style="color: black;">倘若</span>想要查看效果,<span style="color: black;">必须</span>另存为HTML文档(后缀为.html),<span style="color: black;">或</span>桌面上选中文件并重命名,<span style="color: black;">而后</span>手动更改后缀<span style="color: black;">亦</span><span style="color: black;">能够</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下面<span style="color: black;">起始</span>实战操作:(<span style="color: black;">运用</span>专业的<span style="color: black;">研发</span><span style="color: black;">工具</span>很<span style="color: black;">要紧</span>,之后我会<span style="color: black;">举荐</span>几款软件。)</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic2.zhimg.com/80/v2-50ece76dfec4ab358c48527eb960ee65_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">桌面右键-新建-文本文档,<span style="color: black;">而后</span>打开这个文本文档,最好用记事本打开。<span style="color: black;">此时</span>候并不<span style="color: black;">必须</span>每次都手动<span style="color: black;">选取</span>记事本,<span style="color: black;">能够</span>设置默认程序。要<span style="color: black;">认识</span><span style="color: black;">更加多</span>信息,详见:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">panda456:Windows 10<span style="color: black;">怎样</span>设置默认程序?</span><span style="color: black;">14 赞同 · 6 评论<span style="color: black;"><span style="color: black;">文案</span></span></span></span></a></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">打开后,<span style="color: black;">咱们</span>先输入:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><!DOCTYPE html></span></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这<span style="color: black;">暗示</span>什么呢?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">所有的HTML文档都<span style="color: black;">必要</span>以此开头,用来声明这是一个HTML文档,让浏览器更方便地判断文档类型。<span style="color: black;">每一个</span>HTML文档的开头<span style="color: black;">必要</span>是这行代码,并且只<span style="color: black;">显现</span>一次。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">回车以进行换行。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>再输入:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><</span><span style="color: black;">html</span><span style="color: black;">></span>
<span style="color: black;"></</span><span style="color: black;">html</span><span style="color: black;">></span>
</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这又是什么意思?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HTML文档的本身要以<html><span style="color: black;">起始</span>,以</html>结束。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">而后</span>在中间空出的一行中,再输入:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><</span><span style="color: black;">body</span><span style="color: black;">></span>
<span style="color: black;"></</span><span style="color: black;">body</span><span style="color: black;">></span>
</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这又是什么意思?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">顾名思义,这中间相当于HTML文档的「身体」。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">主体结构已完工:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic2.zhimg.com/80/v2-d225a61bae084afbd643e691d29310b1_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下面进行网页的主体编写。先写些什么呢?不如先添加一个标题吧。输入:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><</span><span style="color: black;">h1</span><span style="color: black;">></span>Hello world! <span style="color: black;"></</span><span style="color: black;">h1</span><span style="color: black;">></span></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">至于<span style="color: black;">为何</span>要输入 Hello world! ,参见:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">panda456:番外篇(1):Hello World 中夹杂着的情感……</span><span style="color: black;">2 赞同 · 0 评论<span style="color: black;"><span style="color: black;">文案</span></span></span></span></a></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>想要<span style="color: black;">调节</span>标题的<span style="color: black;">要紧</span>性(<span style="color: black;">亦</span><span style="color: black;">便是</span><span style="color: black;">体积</span>),前面和后面<span style="color: black;">能够</span><span style="color: black;">调节</span>成<h2>和</h2>,<span style="color: black;">始终</span>到<h6>和</h6>:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><</span><span style="color: black;">h1</span><span style="color: black;">></span>这是一级标题<span style="color: black;"></</span><span style="color: black;">h1</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">h2</span><span style="color: black;">></span>这是二级标题<span style="color: black;"></</span><span style="color: black;">h2</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">h3</span><span style="color: black;">></span>这是三级标题<span style="color: black;"></</span><span style="color: black;">h3</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">h4</span><span style="color: black;">></span>这是四级标题<span style="color: black;"></</span><span style="color: black;">h4</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">h5</span><span style="color: black;">></span>这是五级标题<span style="color: black;"></</span><span style="color: black;">h5</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">h6</span><span style="color: black;">></span>这是六级标题<span style="color: black;"></</span><span style="color: black;">h6</span><span style="color: black;">></span>
</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">效果如下:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic1.zhimg.com/80/v2-7e57c14acffc3adc898856c4bcc603cc_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">添加完标题之后,再添加一段文字吧。回车进入新的一行,输入:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><</span><span style="color: black;">p</span><span style="color: black;">></span>这是一段文字,<span style="color: black;">能够</span><span style="color: black;">按照</span>自己的需求进行替换。<span style="color: black;"></</span><span style="color: black;">p</span><span style="color: black;">></span></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">至此,记事本里<span style="color: black;">便是</span>这些代码,不爱学习的小伙伴们直接拿去复制:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><!DOCTYPE html></span>
<span style="color: black;"><</span><span style="color: black;">html</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">body</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">h1</span><span style="color: black;">></span>Hello world! <span style="color: black;"></</span><span style="color: black;">h1</span><span style="color: black;">></span>
<span style="color: black;"><</span><span style="color: black;">p</span><span style="color: black;">></span>这是一段文字,<span style="color: black;">能够</span><span style="color: black;">按照</span>自己的需求进行替换。<span style="color: black;"></</span><span style="color: black;">p</span><span style="color: black;">></span>
<span style="color: black;"></</span><span style="color: black;">body</span><span style="color: black;">></span>
<span style="color: black;"></</span><span style="color: black;">html</span><span style="color: black;">></span>
</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">保留</span>后关闭。右键-重命名-将后缀名改为.html-完成!</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span><span style="color: black;">无</span><span style="color: black;">表示</span>后缀名,请参见这篇<span style="color: black;">文案</span>:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">panda456:Windows 10<span style="color: black;">怎样</span><span style="color: black;">表示</span>文件名后缀?</span><span style="color: black;">19 赞同 · 7 评论<span style="color: black;"><span style="color: black;">文案</span></span></span></span></a></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">而后</span>用浏览器打开。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>浏览器<span style="color: black;">表示</span>出的是以下界面,<span style="color: black;">那样</span>恭喜你,成功了。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic4.zhimg.com/80/v2-aa0103080dfce49e385f69b4f2b831a3_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">重视</span>:<span style="color: black;">倘若</span>你的浏览器窗口够长,你只会看到一个标题和一行文字。上面的截图<span style="color: black;">由于</span>窗口太小,<span style="color: black;">因此</span>会<span style="color: black;">经过</span>换行的方式<span style="color: black;">调节</span>文本格式,<span style="color: black;">实质</span>上并<span style="color: black;">无</span>换行。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">总结及<span style="color: black;">重视</span>事项:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">1.HTML文档的主体结构长<span style="color: black;">这般</span>(这是最最<span style="color: black;">基本</span>的):</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic4.zhimg.com/80/v2-b3efe5ab7f22d74d5c5d14ed026cbc57_720w.webp" style="width: 50%; margin-bottom: 20px;"></div><span style="color: black;">照片</span><span style="color: black;">源自</span>于W3School,侵删。<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">其中白色部分是<span style="color: black;">表示</span>在浏览器上的内容。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2.HTML文档的元素结构:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><标记(属性)><span style="color: black;">这儿</span>是<span style="color: black;">详细</span>内容</标记></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">重视</span>:元素是<span style="color: black;">能够</span>嵌套的。例如我在<html>和</html>之间<span style="color: black;">插进</span><body>与</body>,再在中间加入<h1>与</h1>、<p>与</p>等等。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">3.虽然有时HTML文档会自己检测出丢失的标记并补上,<span style="color: black;">然则</span>为了保险并养成良好的习惯,请务必<span style="color: black;">检测</span>自己的前标记(首标记)和后标记(末标记)<span style="color: black;">是不是</span><span style="color: black;">无</span>缺失。例如输入<p>和段落内容后,不要忘记输入</p>!</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">4.有时候,HTML标记不区分<span style="color: black;">体积</span>写。例如<P>会自动转换成<p>,<span style="color: black;">然则</span>为了规范,在输入标记时,<span style="color: black;">尽可能</span><span style="color: black;">运用</span>小写。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">5.除了用中文输入法输入文本内容外,在输入代码时始终<span style="color: black;">运用</span>英文输入法。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这篇<span style="color: black;">文案</span>的内容到<span style="color: black;">这儿</span>就结束了,附上参考资料:<a style="color: black;">W3Schools</a>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下期<span style="color: black;">文案</span>:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">panda45</span></span></a>6:HTML中<span style="color: black;">针对</span>颜色的应用<span style="color: black;">19 赞同 · 0 评论<span style="color: black;"><span style="color: black;">文案</span></span></span></div>
你的言辞如同繁星闪烁,点亮了我心中的夜空。 楼主节操掉了,还不快捡起来!
页:
[1]