Home > CMS Tutorial > WordPress > body text

How to center WordPress images

Release: 2019-07-25 13:32:32
Original
4306 people have browsed it

How to center WordPress images

When many people use wordpress, some people always ask this question, why can I freely control the left, right and center display of pictures in the wordpress editor? Is the text surrounding the picture, but it cannot be displayed when it reaches the front desk? They are all on the left, and the style is messy.

Log in to the WordPress backend and enter the WordPress theme editor.

How to center WordPress images

Add the following code at the end of stype.css

/*Alignment*/
.alignleft {
   display:inline;
   float:left;
   margin-right:1.625em;
}
.alignright {
   display:inline;
   float:right;
   margin-left:1.625em;
}
.aligncenter {
   clear:both;
   display:block;
   margin-left:auto;
   margin-right:auto;
}
Copy after login

For more wordpress-related technical articles, please visit wordpress tutorial Column for learning!

The above is the detailed content of How to center WordPress images. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template