How to set up a center to style the div

This article gives some style center
Here Insert Picture Description

To a div in html, class called "center" set up inside

This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.

This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.

Then in the "center" set below

Note: Unless already declared DOCTYPE, otherwise the margin:! Auto in IE8 and earlier versions are not valid.

First look at the effect
Here Insert Picture Description

Background of the picture area and not centered

Next, add a line of code
Here Insert Picture Description

In the "center" style in his party "margin-auto"

Next to see results
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_44540360/article/details/92760508