控制缩略图常见的是JS来控制,还有就是最直接的方法定义img的宽高;
下面两种方法自适应宽和高,zhenzhai推荐使用CSS方法;
一、CSS方法;
主要是在CSS设置最小值和最大值(max-width: 100px; max-height: 100px; width: expression(this.width >100 && this.height < this.width ? 100: true); height: expression(this.height > 100 ? 100: true);)
缩略图自适应宽和高<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
缩略图自适应宽和高
<html xmlns="http://www.w3.org/1999/xhtml">
缩略图自适应宽和高
<style type="text/css">
缩略图自适应宽和高
>
二、JS方法
我就不说了代码写的很清楚
缩略图自适应宽和高<script type="text/javascript">
缩略图自适应宽和高
缩略图自适应宽和高
//改变透明度参数:图片对象,透明度:1-100的值
>

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-06-12
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2022-12-23
  • 2021-11-21
  • 2021-10-05
  • 2021-07-19
相关资源
相似解决方案