HTML Basic
HTML meta http-equiv attribute
The HTML meta http-equiv attribute provides information about the content attributes of the web page header ( HTML head ), such as web page auto-update, web content encoding, priority styles, etc., which can be set through the HTML meta http-equiv attribute. The early HTML version supports meta http-equiv attributes, and most mainstream browsers also support it.
HTML meta http-equiv basic syntax
<meta http-equiv="attribute value" content="content">
The writing method is quite simple. There are three common attribute values, namely content-type, default-style, and refresh. The content-type is used to set the web page encoding, the default-style is used to set the default style, and the refresh is used to set the automatic update. At time, no matter which attribute value is used, it must be matched with a content to tell the browser what the content is. The entire HTML meta http-equiv must be written in the HTML head area, and the three attributes can be written in the same web page.HTML meta http-equiv example
<head>
<title>This is the test page</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content= "10">
</head>
As shown in the example, it is a fairly standard way of writing. Each group of meta http-equiv is written in the head area. The first group means that the web page is encoded as universal code UTF-8, and the second group means every 10 seconds. Automatic update. These two projects have other alternatives in the current web design technology category. For example, setting the web page code in HTML5 standard writing is more concise, web page automatic update can use JavaScript syntax, using meta http-equiv The advantage is that almost all major browsers support it.<title>This is the test page</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content= "10">
</head>
The difference between HTML meta http-equiv attribute in HTML 4.0 and HTML 5
mentioned in the previous paragraph about the standard way of writing in HTML5, which can make the code of webpage coding cleaner. This is for sure. HTML5 webpage coding declaration can be written like this
<meta charset="UTF-8">
It is indeed more concise than the traditional verbose writing, and the placement is also in the HTML head area.
Post a Comment
0 Comments