控制第三方脚本图像的大小

时间:2009-04-17 11:00:04

标签: html

我的网页中嵌入了以下脚本:

<script src="http://www.weatherforecastmap.com/weather2.php?zona=malaysia_kuala-lumpur" ></script>

鉴于脚本将显示图像,我将脚本嵌入到面板中。无论如何要确保图像脚本会自动调整大小(以便图像始终位于面板内),具体取决于屏幕大小?

1 个答案:

答案 0 :(得分:1)

将该脚本放入具有固定宽度的div中并对图像进行样式设置 - 即:

<div id="thescript">
  <script src="..."></script>
</div>

风格:

/* CSS */
#thescript{
  width: 200px;
  height: 200px;
  overflow: hidden;
}

/* alternative */
#thescript img{
  width: 200px;
}

另一方面,如果你想依赖屏幕尺寸,我想你正在寻找%宽度而不是固定像素。

相关问题