WordPress CSS to achieve adaptive control article image width and height size

Mountain modify the site is not working today because the automatic collection of pictures, the website stretch, as shown:

014849PwU wordpress实现css控制文章图片自适应大小宽度和高度

Hold the left column, and then from the Internet to find relevant information, modify as follows:

Many wordpress themes are not set adaptive image size when you insert a picture essay, if not larger picture resize manually, then the picture would be too out of bounds. In this regard, we can modify the CSS to solve, the bigger picture to set the maximum width, so it appears within the scope of the article.

1. Find the website or wordpress theme CSS file, usually style.css.

2. Next, find the article .entry label, the following label .entry add the following code:

1 entry img { 
2 
3 max-width: 600px; 
4 
5 width: expression(this.width > 600 ? "600px": 
6 (this.width+"px"));height:auto; 
7 }

600 which is to set the width.

The above topics according to their own design style, this amendment is not working mountain eStore themes, so finding CSS article template for .post control, so modify the code as follows:

1 .post img { 
2 
3 max-width: 600px; 
4 
5 width: expression(this.width > 600 ? "600px": 
6 (this.width+"px"));height:auto; 
7 }

We’ll amend article as shown:

014849MMC wordpress实现css控制文章图片自适应大小宽度和高度

Friends can follow the above method to change it yourself.