Home >Web Front-end >H5 Tutorial >Summary of all elements and basic grammar of H5

Summary of all elements and basic grammar of H5

php中世界最好的语言
php中世界最好的语言Original
2018-01-10 09:57:094743browse

This time I will bring you a summary of all the elements and basic syntax of H5. What are the precautions for using the elements and basic syntax of H5. Here are practical cases, let’s take a look.

HTML tag
Opening tag: open tag
Ending tag: closing tag

Element
Definition: HTML element refers to the code from the start tag to the end tag (the element starts with the start tag and ends with the end tag). The content of the
element: the content of the element refers to the code between the start tag and the end tag. Characteristics of content

elements:
1. Most HTML elements can be nested (can include other HTML elements)
2. HTML documents have nested HTML elements Composition
3, don’t forget the closing tag, future HTML versions will not allow omitting the closing tag
4, empty html element
5, an html element without content is called the empty content of the element, and the empty element is
closed in the start tag Note:
The difference between empty elements and empty content: the start tag and end tag of empty elements are the same, the focus is on the tag. Empty content means that the content within the element is empty, and the focus is on the content.

HTML basic structure
aba7b36f87decd50b18c7e3e3c150106: Not a tag, just used to declare to help the browser correctly display the web page
93f0f5c25f18dab9d176bd4f6de5d30e9c3bca370b5104690d9ef395f2c5f8d1 elements are all headers The container of the element
e8e496c15ba93d81f6ea4fe5f55a2244 tag is always located in the head element. The tag provides metadata about the HTML document.
c9ccee2e6ea535a969eb3f532ad9fe89 The tag is used to define style information for the HTML document.
b2386ffb911b14667cb8f0f91ea547a7b25a9407cfe693f10872c2a72988c045Define the title of the document
The text between6c04bd5ca3fcae76e30b72ad730ca86d36cc49f0c466276486e50c850b7e4956 is the content of the web page courseware
The text between100db36a723c770d327fc0aef2ce13b173a6ac4ed44ffec12cee46588e518a5e describes the web page

HTML attributes
html tags can have attributes that provide more information about html elements
Attributes always appear in the form of name/value pairs
Attribute values ​​should always be enclosed in brackets, double Quotation marks are the most common, but there is no problem with using single quotes

HTML comments
You can insert comments in the code to improve the readability of the code, and the comments will not be displayed on the page , the browser will ignore them
Format: e32ee7f58668a69603ca4d1b2b5f53b3

<!doctype html>  
<html>  
<head>  
<meta charset="utf-8">  
<title>无标题文档</title>  
<style>  
  
#box1{   
    background-color:red;   
}   
.div1{background:yellow;}   
.div2{border:1px solid #000;}   
  
</style>  
</head>  
  
<body>  
  
<!-- id只能是唯一的 -->  
<div style="width:100px; height:100px; border:1px solid #000;" id="box1 box2"></div>  
    
  
<!--class可以是多个的-->  
<div  style="width:100px; height:100px;"  class="div1 div2" ></div>  
  
<!--class可以是多个的-->  
  
<a href="#" title="我是一个提示信息">我是一个链接</a>  
  
</body>  
</html>

I believe you have mastered the method after reading these cases. For more exciting content, please pay attention to php Chinese Other related articles online!

Related reading:

About how to handle old versions of browsers that are not compatible with H5 and C3

12 Unpopular H5 design tips

How to use postMessage in H5 to transfer data between two web pages

The above is the detailed content of Summary of all elements and basic grammar of H5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn