Home > Article > Web Front-end > What are the tag nesting rules in css
Introduction to nesting rules:
(Recommended tutorial: css quick start)
1. The body can directly contain blocks Shape elements, ins, del, script, etc. cannot directly contain inline elements;
2, ins and del (inline elements) can contain block elements or inline elements, and any other inline elements are not allowed to contain block elements. Elements;
3, p, h1-h6 can directly contain inline elements and text information, but block elements are not allowed;
4, dl elements are only allowed to contain dt and dd, and at the same time dt cannot contain block elements, only inline elements are allowed, and dd can contain any element;
5. The form element cannot directly contain input elements. The reason is that the input element is an inline element, and the form element can only contain block elements;
6. The table element can only contain caption, colgroup, col, thead, tbody, tfoot, and cannot directly contain tr or anything else. element;
The above is the detailed content of What are the tag nesting rules in css. For more information, please follow other related articles on the PHP Chinese website!