Blogger Information
Blog 23
fans 0
comment 3
visits 23401
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
HTML中元素、标签、属性之间关联与区别
a.
Original
1859 people have browsed it

就我自己理解下HTML元素、标签、属性是什么

HTML元素

HTML元素是HTML文档中一个标签开始到结束,称之为元素。HTML就是由无数个元素组成,例如下面的代码就是一个元素

  1. <p>今天湖北的天气真好。</p>

HTML标签

HTML标签就是由“<>”肩括号包起来的英语单词,有的可能也不是单词。标签大部分都是成对出现<p></p>这就是一对标签,<head></head>这也是一对标签。<p>是开始标签,
</p>是结束标签。<br><hr>这就是单标签

标签属性

如果说标签告诉了浏览器我是什么,比如<a href="#">打开连接</a>告诉了浏览器我是一个链接,那么标签里面的href="#"就是定义了这个链接的附加属性,连接到那里,以新窗口打开还是原窗口打开。属性以名值对的方式写在开始标签中

关联与区别

  • 关联:标签属性定义了标签的附加属性,完整的一对标签构成了一个元素,无数个元素构成了HTML文档
  • 区别:功能上的区别,属性中的名值对用来定义标签的附加属性,标签告诉了浏览我是什么,元素构成了HTML文档
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
1 comments
葵花宝典 2020-12-12 20:35:13
大佬,怎么只总结了第1条,共5条啊, 我是来抄作业的
1 floor
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!