No need to waste time, effort, or bytes adding it. Search engine optimization snake-oil salespeople abused the keywords meta tag by stuffing them with comma-separated lists of spam words instead of lists of relevant key terms, so search engines do not consider this metadata to be useful anymore. In addition to viewport, you will probably want to include description and theme-color, but not keywords. The name attribute is the name of the metadata. As with pragma directives, the content attribute is required. Include the name attribute, with the attribute value being the name of the metadata. More often than not, you'll include named metadata. If you don't have access to change HTTP headers (or if you do), here is a list of space separated content values for content-security-policy directives. Content policies mostly specify allowed server origins and script endpoints, which help guard against cross-site scripting attacks. The most useful pragma directive is content-security-policy, which enables defining a content policy for the current document. We won't include this in our site because there is no reason to time out a user session other than to annoy our visitors. If you are going to set a refresh with a redirect, make sure the user has enough time to read the page, a link to hasten the process, and, if appropriate, a button to "stop the clock" and prevent the redirect from happening. Don't you hate it when you're in the middle of a paragraph and the page resets? Imagine having cognitive or vision issues and that happening. Refreshing and redirecting content without an explicit user request to do so is poor usability and negatively impacts accessibility. While you can set a directive to refresh at an interval of the number of seconds set in the content attribute, and even redirect to a different URL, please don't. The most common pragma directive is the refresh directive. For example, while you can include a language directive with, we have already discussed using the lang attribute on the HTML element, which is what should be used instead. The specification defines seven pragma directives, most of which have other methods of being set. Supported http-equiv values enable setting directives when you are unable to set HTTP headers directly. These directives describe how the page should be parsed. The http-equiv attribute has as its value a pragma directive. Both the name and http-equiv meta types must include the content attribute, which defines the content for the type of metadata listed. There are two main types of meta tags: pragma directives, with the http-equiv attribute like the charset meta tag used to have, and named meta types, like the viewport meta tag with the name attribute that we discussed in the document structure section. Aside from the charset exception, all other meta tags defined in the WHATWG HTML specification contain either the http-equiv or name attribute. This is short for "http-equivalent", as the meta tag is basically replicating what could be set in an HTTP header. You may have noticed the original character set meta declaration used to include the http-equiv attribute. It is standardized now in the HTML living standard as " />, where, for HTML, is the case-insensitive string "utf-8". ![]() Originally the character set meta data was written as " />, but so many developers mis-typed the content attribute as content="text/html" charset="" that browsers began supporting charset as an attribute. The charset attribute of the element came about in a unique manner. Let's revisit the two necessary tags already covered-the character set declaration and the viewport meta tag-and get a better understanding of the tag in the process. In this section, we'll discuss the attributes and values that are included in the specifications, some common meta names and content values, and a few meta types that are incredibly useful for search engine optimization, social media posting, and user experience that are not officially defined by the WHATWG or W3C. The specification includes several meta types, and there are many, many other application-supported meta types not in any official specification. While everything in the, including the, ,, , and the lesser used, is actually "meta data", there is a tag for metadata that cannot be represented by these other elements. In the document structure section you learned about the components you (almost) always find in the of an HTML document.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |