Home  >  Article  >  CMS Tutorial  >  How to center WordPress images

How to center WordPress images

尚
Original
2019-07-12 13:12:174285browse

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;
}

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!

Statement:
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