0

请参阅:http ://silverbacksport.com/rugby_collection.html

这是我正在使用的 HTML:

<table style="width: 100%" cellpadding="8" cellspacing="9" align="center">
    <tr>
        <td class="auto-style5" style="width: 167px">
            <img alt="" src="Images/RUGBY%20-%20Template1%20-%20thumb.jpg" 
                onmouseover="this.src='Images/RUGBY - Template1.gif'"
                onmouseout="this.src='Images/RUGBY - Template1 - thumb.jpg'" />
        </td>
        <td class="auto-style5" style="width: 167px">
            <img alt="" src="Images/RUGBY%20-%20Template2%20-%20thumb.jpg"
                onmouseover="this.src='Images/RUGBY - Template2.gif'"
                onmouseout="this.src='Images/RUGBY - Template2 - thumb.jpg'" />
        </td>
    </tr>
</table>

有没有办法可以将放大的图像放在鼠标悬停上,使其保持在页面垂直边框的范围内?

4

1 回答 1

1

你可以用max-width这个。

img {
  max-width: 300px;
}

这样,您将控制图像扩展的程度。您可以将它max-width用于图像的容器,并用于width: 100%图像。这样,浏览器将自动检查最适合当前容器大小的分辨率。

于 2013-10-23T04:08:40.150 回答