And these elements have an order, with the h1 being the highest. Heading elements are used to describe different sections of a web page. HTML has different heading elements which are h1, h2, h3, h4, h5 and h6. The post itself showing the cover image, the title, and post text content is the central part, which would be in the main element. The social media sharing on the left, advertisements on the right, header, and footer are minor parts of the web page. This would be the content related to the website's title.įor example, a blog post page. The main tag specifies the essential content of a website. Any element not found here (which could be included in the head tag) will not be shown on the screen. Although non-visible elements like style and script can also be added here, most body tags are usually visible.įrom headings to paragraphs to media and lots more, those elements are added here. The body tag houses the body content of a website, which is visible to users. The most common use of this tag is to add stylesheets to a document and to also add favicons to a website: Ī favicon is a small image close to the title of the webpage, as seen below: body tag įor example, as seen in the code block above, we've established a "stylesheet" document relationship with the styles.css file. Usually, this establishes different kinds of relationships between the current document and a separate document. You use the link tag, as the name implies, to link to another document. This tag also helps search engines show titles for your website on their search results: link tag Your browser uses this to display a title at the title bar: The title tag is used to specify a title for your website. Search engines, social media platforms, and web services use this metadata to understand the content of your website and determine how to present them to users. adding a character encoding for your website.adding metadata for social media platforms to create link previews.You can use these tags for various purposes: The meta tag is a metadata element used to add more metadata to your website than the kind that non-meta tags like title provide. Metadata in the head tag includes meta tags, title tags, link tags, scripts, stylesheets, and more. Search engines especially use this data to rank your website. These are visually invisible data to the user, but they provide information about your website's content. The head tag houses the metadata of your website. The default value is "unknown", so it is recommended that you always specify a language.ĭefining a language helps screen readers read words correctly and helps search engines return language-specific search results. It also has the lang attribute, which you can use to specify the language of the text content on a website. It houses the head tag, the body tag, and every other HTML element (except the DOCTYPE) used in your website. The html tag is the root of the HTML document. This is important, because without this declaration, HTML5 elements like section, article, and so on may not be rendered correctly. tells the browser to render the HTML codes as HTML5 (as opposed to some other version of HTML). This element is the doctype declaration of the HTML file. In the rest of this article, I'll explain what each part of this boilerplate means. A basic boilerplate for an HTML file looks like this: HTML has different tags, some of which have semantic meanings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |