If you paste the above code into a .html file, you will have a web page! This basic HTML5 template contains some of the elements listed in the next section, as well as a simple title element that will be displayed in your web browser. <\/p>\n
Let's take a closer look at its structure. <\/p>\n
Structure of HTML5 template<\/strong><\/p>\n HTML templates usually contain the following parts: <\/p> In addition to document type declarations and HTML5 Document Type Statement<\/strong><\/p>\n Your HTML5 template needs to start with a document type declaration or doctype<\/em>. doctype is just one way to tell the browser or any other parser what type of document it is looking at. For HTML files, this means a specific version and type of HTML. doctype should always be the first item at the top of any HTML file. Many years ago, the doctype declaration was an ugly and hard to remember confusion, usually designated as \"XHTML Strict\" or \"HTML Transitional\". <\/p>\n With the advent of HTML5, those unintelligible annoying things disappeared, and now you only need this: <\/p>\n Simple and clear. \"5\" disappeared clearly from the statement. Although the current version of the web tag is called \"HTML5\", it is really just an evolution of previous HTML standards—the future specifications will be just the development we have today. There will never be \"HTML6\", so the web tag of the current state is usually simply called \"HTML\". <\/p>\n Because the browser needs to support old content on the web, it does not rely on doctype to tell the browser what features should be supported in a given document. In other words, just doctype doesn't make your page compliant with modern HTML features. In fact, regardless of the doctype used, the browser will determine the feature support case by case. In fact, you can use the old doctype with the new HTML5 element on the page and the page renders the same way as when using the new doctype. <\/p>\n How to use tags in HTML<\/strong>\nThe <\/p> section contains important information about the document, which is not displayed to the end user - such as character encoding and links to CSS files, and possibly JavaScript files. This information is used by machines such as browsers, search engines, and screen readers: tags above are important, but end users don't see it - except for the How to use tags in HTML<\/strong><\/p>\nThe The value of the HTML document character encoding<\/strong><\/p>\nThe first line in the HTML document Note: To ensure that some older browsers read character encoding correctly, the entire character encoding declaration must be included somewhere in the first 512 characters of the document. It should also appear before any content-based element (like the The above character encoding example uses the UTF-8 character set. In almost all cases, UTF-8 covers a variety of characters, including many characters in various languages ??around the world, as well as many useful symbols. As the World Wide Web Alliance explains: <\/p>\n Unicode-based encodings (such as UTF-8) can support multiple languages ??and can be adapted to any language mixed pages and forms. Its use can also eliminate server-side logic, thereby individually determining the character encoding for each service page or for each incoming form submission. This greatly reduces the complexity of handling multilingual websites or applications. <\/p><\/blockquote>\n The full explanation of character encoding is beyond the scope of this article, but if you want to dig deeper, you can read about character encoding in the HTML specification. <\/p>\nWhat does You sometimes see this line in This meta tag allows web authors to select the version of Internet Explorer that should render the page. Now that Internet Explorer is largely just a bad memory, you can safely remove this line from your code. (We've removed it from the HTML5 template.) If you're sure your page might be viewed in an older version of IE, it might be worth including it. You can read more about this meta tag on the Microsoft website. <\/p>\n Viewport element<\/strong><\/p>\n Viewport element is a feature you will see in almost every HTML5 template. It is very important for responsive web design and mobile-first design: <\/p>\n This You can read more about these meta-element properties on MDN, but now you just need to know that in most cases, this meta-element and its settings are best for mobile-first responsive websites. <\/p>\n The next part of the HTML base template contains the following three lines: <\/p>\n You can place any number of valid element elements in Open Graph element for social cards<\/strong><\/p>\n As mentioned above, all meta elements are optional, but many are good for SEO and social media marketing. The next part of the HTML5 template contains some of these meta-element options: <\/p>\n These Those elements included here will enhance the appearance of the webpage when linked to social media posts. For example, the five When you see posts shared on social media, you will usually see these bits of data are automatically added to social media posts. For example, if you include a link to the GitHub homepage, the following will be displayed in the tweet. <\/p>\n Favicon and Touch icons<\/strong><\/p>\n The next part of the HTML5 template contains Favicon will appear in the browser tab when someone checks your website. The last element references the icon used on Apple devices when adding the page to the user's home screen. <\/p>\n You can include additional options here, including web application manifest files that reference other icons. For the full discussion, we recommend that you read Andrey Sitnik's article on this topic. But those included here are enough for simple HTML beginner templates. <\/p>\n Contains CSS stylesheets and JavaScript files<\/strong><\/p>\n The last two important parts of the HTML Getting Started Template are references to one or more stylesheets and possibly JavaScript files. Of course, both are optional, although few sites don't have at least some CSS styles. <\/p>\n Stylesheets can be included anywhere in the document, but you will usually see it in the Note that we added the It is worth noting that you do not have to use the \n
<\/code>Element<\/li>\n
<\/code> elements, most of the elements listed above are located in the
<\/code> section of the HTML template. <\/p>\n
\n\n\n \n \n
国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂
\n Page Title<\/h1>\n ?>\n<\/body>\n<\/html><\/pre>\n
<\/code>Element<\/strong><\/p>\nThe
<\/code> element is the top level element in an HTML file—which means it contains everything except doctype in the document. The
<\/code> element is divided into two parts—
<\/code> and
<\/code> parts. All other content in the webpage file will be placed in or inside the
<\/code> element. The following code shows the
<\/code> element, which is located after the doctype declaration and contains the
<\/code> and
<\/code> elements:
<\/code>\n<\/p>\n
<\/pre>
<\/code>\n<\/p>\nAll elements contained between the
\n \n <\/head>\n \n <\/body>\n<\/html><\/pre>…
<\/code> text, it will appear in online search and browser tags.
<\/head><\/code>
<\/code> section contains everything displayed in the browser - such as text, images, etc. If you want to show something to the end user, make sure to place it between the on and off
<\/code>…
<\/body><\/code> tags: <\/p>\n
\n\n\n \n \n
Page Title<\/h1>\n ?>\n<\/body>\n<\/html><\/pre>\n
<\/p>\n
lang<\/code>What are the attributes? <\/strong><\/p>\nThe
<\/code> element should ideally contain the
lang<\/code> attribute, as shown in the above code (
<\/code>). Its main purpose is to tell assistive technologies such as screen readers how to pronounce them when reading aloud. (This property is not required for page validation, but most validators will issue warnings if you do not include it.) <\/p>\n
lang<\/code> attribute shown above is
en<\/code>, which specifies that the document is written in English. All other spoken languages ??have values, such as
fr<\/code> in French,
de<\/code> in German,
hi<\/code> in Hindi, etc. (You can find a complete list of language codes on Wikipedia.) <\/p>\n
<\/code> section is the line that defines the character encoding of the document. The letters and symbols we read on web pages are defined as a series of numbers, and some characters (such as letters) are encoded in many ways. Therefore, it is useful to tell your computer which encoding your web page should refer to. Indicator character encoding is an optional feature that does not cause any warnings in the validator, but for most HTML pages it is recommended: <\/p>\n
<\/pre>\n
Why use UTF-8 character encoding in HTML5 templates? <\/h3>\n
utf-8<\/code> is the value you should use in your document. This encoding covers various characters not included in other encodings. You may have encountered strange characters on the web - for example - which is obviously a bug. This is usually because the browser cannot find the expected characters in the character set specified in the document. <\/p>\n
\n
X-UA-Compatible<\/code> mean? <\/strong><\/p>\n
<\/code> of your HTML document: <\/p>\n
\n\n\n \n \n
Page Title<\/h1>\n ?>\n<\/body>\n<\/html><\/pre>\n
<\/pre>\n
<\/code> element contains two properties that work together as a name\/value set. In this case, the name is set to
viewport<\/code> and the value is
width=device-width, initial-scale=1<\/code>. This is for mobile devices only. You will notice that there are two parts of the value: <\/p>\n
\n
width=device-width<\/code>: The pixel width of the viewport you want the website to present. <\/li>\n
initial-scale<\/code>: This should be a positive number between 0.0 and 10.0. The value of \"1\" indicates a 1:1 ratio between the device width and the viewport size. <\/li>\n<\/ul>\n
\n \n <\/head>\n \n <\/body>\n<\/html><\/pre>\n
<\/code> section. Description and author metaelements are optional, but they do provide important information for search engines. In the search results, the title and description in the above code example will be shown below. <\/p>\n
<\/p>\n
<\/code>. <\/p>\n
\n \n \n
<\/code> elements utilize the so-called Open Graph protocol, and there are many other elements you can use. These are the elements you use most frequently. You can view a complete list of available Open Graph meta options on the Open Graph website. <\/p>
<\/code> elements included here will appear in a social card embedded with the following data: <\/p>\n
\n
<\/p>\n
<\/code> elements that indicate the resources to contain as favicon and Apple touch icons: <\/p>\n
\n\n\n \n \n
Page Title<\/h1>\n ?>\n<\/body>\n<\/html><\/pre>\n
favicon.ico<\/code> Files are used in older browsers and do not have to be included in the code. As long as your
favicon.ico<\/code> file is included in the root directory of the project, the browser will automatically find it.
favicon.svg<\/code> Files are used in modern browsers that support SVG icons. You can also use .png files instead. <\/p>\n
Include CSS stylesheet in HTML template<\/h3>\n
<\/code> section: <\/p>\n
<\/pre>\nThe
<\/code> element points the web browser to an external stylesheet so that it can apply these CSS styles to the page. The
<\/code> element requires the
rel<\/code> attribute to be
stylesheet<\/code>. In the past, there was usually also a
type<\/code> attribute, but it was never really needed, so if you find the old code that contains it on the web, just delete it. <\/p>\n
?v=1.0<\/code> query string at the end of the CSS link. This is completely optional. This is a handy trick when you update the stylesheet to update this query string (for example, update to 1.1 or 2.0), because doing so ensures that the browser will discard any old, cached copy of CSS files and load the new one version. <\/p>
<\/code> element to include CSS on the webpage, as you can instead put all styles inside the