2. Elements, Attributes

HTML elements defined by the HTML document
HTML document consists of nested HTML elements

Common elements: the start tag starting to terminate the closing tag, content element is the content between the opening and closing tags

<html></html><!--定义了整个HTML文档,是整个文档的开始到结束-->
<head></head><!--包含了所有的头部标签元素,包括文档的标题,脚本,样式,meta等-->	
<title></title><!--标题-->
<body></body><!--定义文档的主体,文档的所有内容:文本,超链接,图像,表格,列表等-->

Empty element
has no content of the HTML element is called empty elements Empty elements are closed in the start tag of
 

<br /><!--换行-->
<hr  ><!--水平线-->

 

HTML attributes
attribute extensions HTML element is provided; for the modified style tags appear as name / value pair (key-value pair)
Note: the attribute value is always included in the quotation marks, if the attribute value itself with quotation marks, then use single quotation marks, and not case sensitive

class:为html元素定义一个或多个类名
id:定义元素的唯一id
style:规定元素的内联样式(css样式)
title:规定元素的额外信息(可在工具提示中显示)

<p class=""></p>
<p id=""></p>
<p style=""></p>
<p title=""></p>

 

 

Published 104 original articles · won praise 22 · views 40000 +

Guess you like

Origin blog.csdn.net/qq_41672557/article/details/105309587