跳到主要内容

HTML标记:基础指南

HTML tags
(形象信用:未来)

+$HTML is the foundation of every website on the web. It defines where the visuals should be placed, what they look like and what behaviour they should have. It is the first thing a browser receives, making it a crucial piece to get right even before the CSS and JavaScript.

+$It is the main driver of the Document Object Model that allows the browser to read the structure of the page and render its contents (see more about+$page Layouts+$here). Elements are created by parsing the tags we write in the markup. Because of this, it’s important to make sure the HTML is correct. The language itself has been improved upon over the years to make sure the syntax used can describe the content within it accurately, and allow consumers to make sense of it.

+$As HTML has evolved, things that were once recommended could now be considered bad practice. It’s important for us to keep on top of the language we use to make sure it best serves the visitors to our sites. Incorrect HTML can cause more harm than good. By ensuring we get the right structure in place we can be sure the content we create is set for the future.

+$element is the most generic container in HTML. By default, it has no styling applied to it, no inherent meaning associated with it and every browser supports it. By applying our own styling, we make it look and behave however we like. While this may sound ideal for visitors in a browser, it comes at a cost to other users and consumers of that content.

+$Read on to discover the basic HTML tags you should be using, and what underlying advantages using the right tags will bring to your builds.

+$What are the basic HTML tags?

+$In HTML tags, a semantic element is one that provides meaning to its contents e.g.

+$. A non-semantic element is typically used to apply styling and does not carry any meaning.

+$Before HTML5 introduced a new set of semantic elements, developers would use

+$to achieve the same effect e.g.