All web pages can be based on HTML tags. Let’s summarize the nesting rules of HTML tags in detail. It is very necessary for novices who are learning web pages to see what they are learning about HTML recently, which is a re-understanding of HTML! Don’t underestimate this thing, all web pages are based on it! Let’s summarize the nesting rules of HTML tags in detail below, hoping that they will be helpful to everyone.
There are many tags for XHTML: div, ul, li, dl, dt, dd, h1~h6, p, a, addresssa, span, strong... When we use these tags to build a page structure, we can nest them infinitely, but nesting also requires certain rules, and we cannot let our personal habits nest randomly - XHTML is not XML after all.
In the XHTML language, we all know that the ul tag contains li, dl tag contains dt and dd-necking rules for these fixed tags are very clear. However, there are many tags that are independent and they are not tied together, such as h1, div, p... So what are the nesting rules for these tags? Let’s talk about this topic today.
When it comes to nesting rules for XHTML tags, we must first know that there are two types of XHTML tags:
A type of block element (block)
One type is called inline elements (inline, which many people also call: inline, line level, etc.)
The division standards for block-level elements and embedded elements are very simple. Please put the following two lines of code into the body tag:
Copy the code