.photoresize { max-width:600px; myimg:expression(onload=function(){ this.style.width=" />

css最大宽度 css操纵照片的最大宽度及expression学习

2021-01-20 11:58 jianzhan

拷贝编码
编码以下:

<img class="photoresize" style="border:1px solid #ccc; padding:2px; margin:10px;" src="<%=rs("img")%>" />
<style type="text/css">
.photoresize {
max-width:600px;
myimg:expression(onload=function(){
this.style.width=(this.offsetWidth > 600)?"600px":"auto"}
);
}
</style>
.neirong img{max-width:680px;myimg:expression(onload=function(){this.style.width=(this.offsetWidth > 680)?"680px":"auto"});}
#upscroll li{ height:20px; line-height:20px;}