Home >Web Front-end >H5 Tutorial >HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting
## The element refers to all code from the start tag to the end tag .
Element content | End (close) tag | |
this is my web page | 94b3e26ee717c64999d7867364b1b4a3 |
0c6dc11e160d3b678d68754cc175188a is an empty element without a closing tag (0c6dc11e160d3b678d68754cc175188a tag definition wraps).
In XHTML,
XML, and future versions of HTML, all elements must be closed. Adding a slash in the opening tag, such as df250b2156c434f3390392d09b1c9563, is the correct way to close an empty element, and is accepted by HTML, XHTML, and XML.
Even though 0c6dc11e160d3b678d68754cc175188a is valid in all browsers, using df250b2156c434f3390392d09b1c9563 is actually a longer-term guarantee.
HTML element syntax
## The content of elementEmpty elements are closed in the opening tag
Most HTML elements can haveattributes
Nested HTML elementsMost HTML elements can be nested
<p>Hello world, <a>找度娘</a></p>
HTML attributes 1. Tags can have attributes to provide more information for elements
# 3499910bf9dac5ae3c52d5ede7383485:target specifies where to open the connection
4. Common attributes:
classSpecifies the class name of the elementid | Specifies the unique ID of the element | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
style | Specify the style of the element | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title | Specify the additional information of the element | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <!--id规定元素唯一ID--> <title id="1223">基础</title> <!--style规定元素的样式--> <style type="text/css"></style></head><body bgcolor="#5f9ea0"> <h1 align="center">标题1</h1> <a href="index02.html" target="_blank">打开本地</a> <!--class规定元素类名--> <h2 class="h2ID">标题2</h2></body></html> HTML格式化 文本格式化标签:
“计算机输出”标签:
引用、引用和术语定义
代码示例: <!DOCTYPE html><html><head> <meta charset="UTF-8"> <title id="1223">格式化</title></head><body> <b>My name is Winson</b> <br/> <big>Welcome to my blog~</big> <br/> <i>Hello, visitor!</i> <br/> <small>我很小, 你看不见 看不见</small> <br/> <strong>太显眼了</strong> <br/> 大家好<sub>欢迎</sub>来到 <br/> 大家好<sup>欢迎</sup>来到 <br/> <ins>Come on! girls!</ins> <br/> <del>Hei! girl!</del></body></html> |
The above is the detailed content of HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting. For more information, please follow other related articles on the PHP Chinese website!