从零开始的html教程(2):了解基本的标签与元素

作者:袖梨 2022-06-25

一、html中的标签

上一课利用dreamweaver自动生成的页面的代码为:

无标题文档

“”””像这样方括号里框着英文与符号的玩意就叫做”标签”,又叫标记标签。

Html是由一堆标签组成的超文本标记语言。以上代码一共9个标签。

标签总是成对出现的,其中第一个字符为英文字母的标签叫开始标签,在同样的英文前加了”/”斜杠符号的叫结束标签。

二、html中的元素

开始标签与结束标签的本体与之间的内容叫元素。上节课生成的代码中,“无标题文档”是一个元素,有着开始标签与结束标签,标签之间的”无标题文档”是这个元素的文本。

元素中是可以嵌套其他的元素的。比如上述例子中,””元素中嵌套了”,,,”这四个子元素,””是它们的父元素,因为它们都被包在(嵌套在)””元素中。

三、上述例子中的标签都是什么意思呢?

1.

这个比较特别,不是html的标签。是用来声明文档类型的,必须要放在标签的前面。如果不用声明的话,浏览器会用”怪异模式(quirks mode)”进行渲染。

2.

用来定义文档的开头与结尾,可以理解成之间就是一个网页。

3.

顾名思义,就是网页的头部,可以修改网页的标题、添加css样式表和加载javascript脚本。

4.</strong></p><p> 用来定义网页的标题。</p><p><a href="https://img.111cn.net/uploads/20220923/img_632d681f72cc433.png" class="js-smartPhoto-pc" target="_blank"><img src="https://img.111cn.net/uploads/20220923/img_632d681f72cc433.png" alt="" /></a></p><p> 网页上的标题就是的内容。</p><p><strong>5.<body></strong></p><p> 网页的主题,网页上用户可视的内容基本都是在这里添加修改。大家想在网页里添加一段文字的话,就得写在里。</p><p><strong>6.<meta></strong></p><p> 这里定义了网页使用UTF-8编码,用在元素里。(标签现在了解就够了)</p><p><span style="color:#E53333;font-size:14px;"><strong>四、如何在自己的网页里加入几段文字呢?</strong></span></p><p> 在这里介绍一个新的标签――<p>标签。</p><p> <P>是段落标签,每个<P>元素为一个段落,即使<p>元素中出现转行,浏览器中也只会显示出空格。</p><p> 不同的<P>元素之间自动空行。</p><p><strong>举个例子:</strong></p><p><strong>1.中间空了一个字符</strong></p><p><a href="https://img.111cn.net/uploads/20220923/img_632d681f9368634.png" class="js-smartPhoto-pc" target="_blank"><img src="https://img.111cn.net/uploads/20220923/img_632d681f9368634.png" alt="" /></a></p><p><strong>2.第一个后面回车键转行</strong></p><p><a href="https://img.111cn.net/uploads/20220923/img_632d681fc445435.png" class="js-smartPhoto-pc" target="_blank"><img src="https://img.111cn.net/uploads/20220923/img_632d681fc445435.png" alt="" /></a></p><p><strong>3.将“段落”放入新的</strong><strong>标签</strong></p><p><a href="https://img.111cn.net/uploads/20220923/img_632d681ff0bbb36.png" class="js-smartPhoto-pc" target="_blank"><img src="https://img.111cn.net/uploads/20220923/img_632d681ff0bbb36.png" alt="" /></a></p><p> <p>元素内不管输入多少空格或者转行,显示出来的结果都始终在同一行里;而将想要另起一行的文字标上<p>标签就会实现自动转行。</p><p><span style="font-size:14px;color:#E53333;"><strong>五、试着随便编辑几段文字并预览一下网站的效果吧!</strong></span></p><p> 点击软件右下角的图片上标记的图标可以实时预览网页的效果。</p><p><a href="https://img.111cn.net/uploads/20220923/img_632d682029ab437.png" class="js-smartPhoto-pc" target="_blank"><img src="https://img.111cn.net/uploads/20220923/img_632d682029ab437.png" alt="" /></a></p><p> 以上就是本次教程的内容了,简单介绍了下html里基本的定义和标签,并且能做出有简单文字的网页了。下次教程将教大家几个常用的标签来充实网站的内容!</p> </div> </div> </section> <section class="wrap-box"> <div class="g-tit"> <h2>相关文章</h2> </div> <ul class="s-list nobord notop"> <li> <a href="/art-422438.htm" class="s-card"> <div class="s-card-l"> <p class="tit">时空中的绘旅人叶瑄逆钟怎么样</p> <div class="info"> <span class="person">游戏攻略</span> <span class="time">2024-11-25</span> </div> </div> <div class="s-card-pic"> <img src="/images/lazy.gif" data-src="/uploads/20241125/logo_674404554ab811.jpeg" alt="时空中的绘旅人叶瑄逆钟怎么样" /> </div> </a> </li> <li> <a href="/art-422437.htm" class="s-card"> <div class="s-card-l"> <p class="tit">光遇11.25大蜡烛在哪里 光遇11月25日大蜡烛位置攻略</p> <div class="info"> <span class="person">游戏攻略</span> <span class="time">2024-11-25</span> </div> </div> <div class="s-card-pic"> <img src="/images/lazy.gif" data-src="/uploads/20241125/logo_6743fde145e141.jpeg" alt="光遇11.25大蜡烛在哪里 光遇11月25日大蜡烛位置攻略" /> </div> </a> </li> <li> <a href="/art-422436.htm" class="s-card"> <div class="s-card-l"> <p class="tit">光遇11.25免费魔法有什么 光遇11月25日免费魔法收集攻略</p> <div class="info"> <span class="person">游戏攻略</span> <span class="time">2024-11-25</span> </div> </div> <div class="s-card-pic"> <img src="/images/lazy.gif" data-src="/uploads/20241125/logo_6743fdded656b1.jpeg" alt="光遇11.25免费魔法有什么 光遇11月25日免费魔法收集攻略" /> </div> </a> </li> <li> <a href="/art-422435.htm" class="s-card"> <div class="s-card-l"> <p class="tit">阴阳师12月新式神是谁 阴阳师2024年12月新式神介绍</p> <div class="info"> <span class="person">游戏攻略</span> <span class="time">2024-11-25</span> </div> </div> <div class="s-card-pic"> <img src="/images/lazy.gif" data-src="/uploads/20241125/logo_6743fdde2dc2c1.jpeg" alt="阴阳师12月新式神是谁 阴阳师2024年12月新式神介绍" /> </div> </a> </li> <li> <a href="/art-422433.htm" class="s-card"> <div class="s-card-l"> <p class="tit">炉石传说西芙骑卡组怎么样 炉石传说西芙骑卡组推荐11月最新</p> <div class="info"> <span class="person">游戏攻略</span> <span class="time">2024-11-25</span> </div> </div> <div class="s-card-pic"> <img src="/images/lazy.gif" data-src="/uploads/20241125/logo_6743fddcb656d1.jpeg" alt="炉石传说西芙骑卡组怎么样 炉石传说西芙骑卡组推荐11月最新" /> </div> </a> </li> <li> <a href="/art-422434.htm" class="s-card"> <div class="s-card-l"> <p class="tit">炉石传说行星萨卡组怎么样 炉石传说行星萨卡组推荐11月最新</p> <div class="info"> <span class="person">游戏攻略</span> <span class="time">2024-11-25</span> </div> </div> <div class="s-card-pic"> <img src="/images/lazy.gif" data-src="/uploads/20241125/logo_6743fddd700d71.jpeg" alt="炉石传说行星萨卡组怎么样 炉石传说行星萨卡组推荐11月最新" /> </div> </a> </li> </ul> </section> <section class="wrap-box"> <div class="g-tit"> <h2>精彩推荐</h2> </div> <ul class="card-box"> <li class="card3"> <a href="/app/99428.htm" target="_self" class="figure"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20241018/671258fc7c56f.png" alt="沙威玛传奇安卓版" /> </div> <p class="figure-head">沙威玛传奇安卓版</p> <span class="figure-btn">下载</span> </a> </li> <li class="card3"> <a href="/app/99427.htm" target="_self" class="figure"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20241018/6711fc29100e3.png" alt="战盟大乱斗最新版" /> </div> <p class="figure-head">战盟大乱斗最新版</p> <span class="figure-btn">下载</span> </a> </li> <li class="card3"> <a href="/app/99426.htm" target="_self" class="figure"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20241018/6711ef93e4d90.png" alt="大侠立志传最新版" /> </div> <p class="figure-head">大侠立志传最新版</p> <span class="figure-btn">下载</span> </a> </li> <li class="card3"> <a href="/app/99425.htm" target="_self" class="figure"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20241018/6711ca5ba8572.png" alt="苍翼混沌效应最新版" /> </div> <p class="figure-head">苍翼混沌效应最新版</p> <span class="figure-btn">下载</span> </a> </li> </ul> <ul class="card-box-b"> <li class="card10"> <a href="/app/99454.htm" target="_self" class="figure2"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20241019/671393f16002e.jpg" alt="驯龙高手旅程安卓版" /> </div> <div class="figure-cont"> <p class="figure-head">驯龙高手旅程安卓版</p> <div class="figure-desc"> <span>模拟经营</span> <span>驯龙高手旅程安卓版</span> </div> <div class="figure-desc"> <p>一款以奇幻世界为背景的模拟经营游戏</p> </div> </div> <span class="figure-btn">下载</span> </a> </li> <li class="card10"> <a href="/app/99397.htm" target="_self" class="figure2"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20241015/670dc626d93dd.png" alt="全民农场最新版" /> </div> <div class="figure-cont"> <p class="figure-head">全民农场最新版</p> <div class="figure-desc"> <span>模拟经营</span> <span>全民农场最新版</span> </div> <div class="figure-desc"> <p>一款轻松风格的农场经营类型的游戏</p> </div> </div> <span class="figure-btn">下载</span> </a> </li> <li class="card10"> <a href="/app/99010.htm" target="_self" class="figure2"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20240907/logo_66dc0ba5ab7021.jpg" alt="散修功德模拟器完整版" /> </div> <div class="figure-cont"> <p class="figure-head">散修功德模拟器完整版</p> <div class="figure-desc"> <span>模拟经营</span> <span>散修功德模拟器完整版</span> </div> <div class="figure-desc"> <p>散修功德模拟器游戏是一款以功德修炼为题材的模拟游戏</p> </div> </div> <span class="figure-btn">下载</span> </a> </li> <li class="card10"> <a href="/app/99001.htm" target="_self" class="figure2"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20240907/logo_66dc094ae30941.jpg" alt="我的毕业日记无限金币下载" /> </div> <div class="figure-cont"> <p class="figure-head">我的毕业日记无限金币下载</p> <div class="figure-desc"> <span>模拟经营</span> <span>我的毕业日记无限金币下载</span> </div> <div class="figure-desc"> <p>开始毕业后的新生活吧!</p> </div> </div> <span class="figure-btn">下载</span> </a> </li> <li class="card10"> <a href="/app/98996.htm" target="_self" class="figure2"> <div class="figure-box"> <img src="/images/lazy.gif" data-src="https://img.111cn.net/uploads/20240907/logo_66dbd35fadafd1.png" alt="城堡之梦拼图和装饰下载最新版" /> </div> <div class="figure-cont"> <p class="figure-head">城堡之梦拼图和装饰下载最新版</p> <div class="figure-desc"> <span>模拟经营</span> <span>城堡之梦拼图和装饰下载最新版</span> </div> <div class="figure-desc"> <p>城堡之梦拼图和装饰玩家将会在游戏当中感受更多的乐趣体验,你可</p> </div> </div> <span class="figure-btn">下载</span> </a> </li> </ul> </section> <footer class="foot"> <a href="/" class="logo-icon"> <img src="/mobile/images/logo2.png" alt="一聚教程网"> </a> <p>Copyright © 2010-2022</p> <p>111cn.net All Rights Reserved</p> </footer> <script> var advData = {"img_fixed_pc_adv":"https:\/\/img.111cn.net\/uploads\/20240509\/663c2e9729f58.jpg","img_fixed_mob_adv":"https:\/\/img.111cn.net\/uploads\/20240509\/663c2e8793225.jpg","url_adv":"http:\/\/shop.hushen.cn\/shop\/c\/baojianpin.html","str_adv":"\u864e\u795e\u5546\u57ce\uff1a\u5173\u7231\u7537\u6027\uff0c\u66f4\u61c2\u7537\u4eba\u3002\u89e3\u51b3\u5927\u4f17\u7684\u7537\u8a00\u4e4b\u9690","img_popup_adv":"https:\/\/img.111cn.net\/uploads\/20240509\/663c2e748238d.png","pc_show_img":"2","pc_show_popup":"2","pc_show_video":"2","mob_show_img":"2","mob_show_popup":"2","mob_show_video":"2","close_adv":"https:\/\/img.111cn.net\/uploads\/20240508\/663b20650801e.png","video_adv":"\/pc\/images\/pc-adv.mp4"}; </script> <script src="/jspc/funcmob.js" type="text/javascript"></script> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-DSRRGRV1TL"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-DSRRGRV1TL'); </script> <div class="back-top" style="display: block;"> <span class="icon-box"> <svg class="icon" viewBox="0 0 1024 1024"> <path d="M213.333333 640h170.666667v256h256v-256h170.666667l-298.666667-341.333333zM170.666667 128h682.666666v85.333333H170.666667z" fill="#0374f3"></path> </svg> </span> </div> </div> <script src="/js/stat.js"></script> </body> </html>