2017-08-10 65 views
2

公司我用我的网站(WordPress的基础)具有“自动博客”,但一些员额具有针对屏幕的方式过大的图像。我希望能够粘贴代码以确保长边只有500px,但保持比例正确。我是新手,所以请让我知道在页面的哪个位置粘贴代码。提前致谢!!! http://embarkre.com/category/real-estate-news自动调整照片大小与HTML(CSS不?)

示例代码:

<div> 
 
<p class="subtitle">ESCAPE One is a road-ready tiny home with 276 square feet of adaptable space.</p> 
 

 
<figure><img src="https://s3-us-west-2.amazonaws.com/dwell-ugc/photos/6063391372700811264/6301479718082105344/large.jpg" alt="" width="700" height="467" /></figure> 
 
<div> 
 

 
For those looking to downsize, Wisconsin-based builder of tiny homes-on-wheels <a href="http://www.escapetraveler.net/" target="_blank">ESCAPE</a> has launched its latest unit, the <a href="http://www.escapetraveler.net/model-one" target="_blank">ESCAPE One</a>. The 276-square-foot Park Model RV resembles a minimalist cottage with a shou-sugi-ban exterior and clean, pine interiors, and can sleep up to four people. 
 

 
</div> 
 
<figure><a href="https://www.dwell.com/article/hit-the-road-with-this-shou-sugi-ban-trailer-asking-just-under-dollar50k-d5961fd8/6301479715116331008"><img src="https://s3-us-west-2.amazonaws.com/dwell-ugc/photos/6063391372700811264/6301479715116331008/large.jpg" alt="" width="1600" height="1066" /></a> 
 
<figcaption>ESCAPE RV/Steve Niedorf </figcaption></figure> 
 
<div>

回答

0

尝试增加你的HTML的HEAD部分内以下。

<style> 
    img { 
    max-width: 500px; 
    height: auto; 
    } 
</style>