这是在网络上显示的两张图片,我都是设置了width="80%" height="30%"图片显示不一致。
还有一个问题:右击左图片的属性,显示的是本页面的链接,并没有这张图片的属性。右边的图片则有。
这个问题并不是所以的左右图片都存在,只是这样的图片占据了总数的40%。
求指教!!!图片网络
还有一个问题:右击左图片的属性,显示的是本页面的链接,并没有这张图片的属性。右边的图片则有。
这个问题并不是所以的左右图片都存在,只是这样的图片占据了总数的40%。
求指教!!!图片网络
调试欢乐多
没有啊,图片都是显示在td里面, 都是设置了width="80%" height="30%"结果如上图,大小不一致感觉
要是源图片大小不一致,百分比后怎么就可能一致了。
至于你说图片的大小两张图片大小并不一致:446*94 1283*376 大小不一样。这个根本不影响,你就是1X1的也一样能把它自动拉大
至于你说图片的大小两张图片大小并不一致:446*94 1283*376 大小不一样。这个根本不影响,你就是1X1的也一样能把它自动拉大 <td><img src="<%=picUrls2 %>" width="80%" height="30%"/></td>
<td> <img src="<%=s2 %>" width="80%" height="30%" /> </td>
这是两张图片,tr,td怎么设置初始值啊
<table style="table-layout: fixed;width:100%;height:100%;">
<tr style="width:100%;height:400px;">
<td style="width:50%;height:400px;"><img src="<%=picUrls2 %>" style="width:100%;height:100%;"/></td>
<td style="width:50%;height:400px;"> <img src="<%=s2 %>" style="width:100%;height:100%;" /> </td>
</tr>
<table>
<c:choose>
<c:when test="${sxnews.grade == 7}">
<td>初一</td> </c:when>
<c:when test="${sxnews.grade == 8}">
<td>初二</td> </c:when>
<c:when test="${sxnews.grade == 9}">
<td>初三</td> </c:when>
<c:otherwise> </c:otherwise>
</c:choose>
<c:choose>
<c:when test="${sxnews.courseid == 1}">
<td>数学</td> </c:when>
<c:when test="${sxnews.courseid == 2}">
<td>英语</td> </c:when>
<c:when test="${sxnews.courseid == 3}">
<td>物理</td> </c:when>
<c:otherwise> </c:otherwise>
</c:choose>
<td>${sxnews.progress }</td>
<td>${sxnews.selection }</td>
<td ><img src="<%=picUrls2 %>" width="80%" height="30%"/></td>
<td> <img src="<%=s2 %>" width="80%" height="30%" /> </td>
</tr>
这是我整个tr
然后你在COPY源代码就好了
最后通过这个js实现的。你们感受一下function AutoResizeImage(maxWidth,maxHeight,objImg){
var img = new Image();
img.src = objImg.src;
var hRatio;
var wRatio;
var Ratio = 1;
var w = img.width;
var h = img.height;
wRatio = maxWidth / w;
hRatio = maxHeight / h;
//------------------------------
if (maxWidth ==0 && maxHeight==0){
Ratio = 1;
} else if (maxWidth==0){//
if (hRatio<1) Ratio = hRatio;
}else if (maxHeight==0){
if (wRatio<1) Ratio = wRatio;
}else if (wRatio<1 || hRatio<1){
Ratio = (wRatio<=hRatio?wRatio:hRatio);
}
//------------------------------
//以上的算法应该是没用的 40%????但是效果确实很好,大黑体字都不见了
Ratio=0.4
if (Ratio<1){
w = w * Ratio;
h = h * Ratio;
}
objImg.height = h;
objImg.width = w;
}
[img=http://img.bbs.csdn.net/upload/201306/18/1371521682_711127.jpg]
感受一下
这个不太清楚哦,图片显示很多的。我只是截图事例。或许是var img = new Image();控件的问题??css我不太熟悉,按照你的css代码更乱了