<\/p>
The rendering is as follows: <\/p>
<\/p>
☆ Horizontal centering setting - fixed-width block element <\/strong><\/p> When the element to be set is a block element, text-align: center will not work. There are two situations: fixed-width block Shape elements and block elements of variable width. Let’s take a look at fixed-width block elements first.
Elements that meet the two conditions of fixed width and block can be centered by setting the \"left and right margin\" value to \"auto\". Let's look at an example of setting the div block element to be horizontally centered:
html code: <\/p> 1 2 3 4 5