In the process of Web page making, we can divide some independent logical parts into a <div>
label, the function of the <div> tag is equivalent to a container.
Grammar:
<div>…</div>
Determine the logical part:
What is the logical part? It is a set of elements that are related to each other on a page. such as the independent section of the page, is a typical logical part. As shown: The section marked with a red border in the figure is a logical part, and the label can be used <div>
as a container.
Example:
<!DOCTYPE HTML><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>div tags</title></Head><Body> <Div> <H2>Top Course Rankings</H2> <ol> <Li>Front-end development interview Heart</Li> <Li>0 Basic Learning HTML</Li> <Li>JavaScript full guide</Li> </ol> </Div> <Div> <H2>Latest Course Rankings</H2> <ol> <Li>Version management tool Introduction-git</Li> <Li>Canvas drawing Detailed</Li> <Li>QQ5.0 Slide Menu</Li> </ol> </Div></Body></HTML>
Understanding the role of Div (division) in typesetting