停止滚动 html 中的最后一个图像

发布于 2024-12-07 13:43:19 字数 825 浏览 1 评论 0原文

我有以下 html-

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
   <style type="text/css">
    .style1 {
        width: 2454px;

    }
   </style>
</head>

<body>
<table width="5964" border="0" cellspacing="13">
  <tr>
   <td width="3484"><img src="images/square.jpg" width="850" height="534" /
   <img src="images/circle.jpg" width="850" height="534" /></td>
   <td class="style1"><img src="images/rectangle.png" width="1134" height="534" /></td>
  </tr>
</table>
</body>

当我在 IE 中查看此页面时,水平滚动条超出了应有的范围,而我需要它停在最后一个图像 rectangle.png 上。

我尝试更改 CSS,将列宽设置为自动,但这不起作用,表格宽度也不起作用。我该如何解决这个问题?

I have the following html-

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
   <style type="text/css">
    .style1 {
        width: 2454px;

    }
   </style>
</head>

<body>
<table width="5964" border="0" cellspacing="13">
  <tr>
   <td width="3484"><img src="images/square.jpg" width="850" height="534" /
   <img src="images/circle.jpg" width="850" height="534" /></td>
   <td class="style1"><img src="images/rectangle.png" width="1134" height="534" /></td>
  </tr>
</table>
</body>

When I view this page in IE the horizontal scrollbar goes much further than it should, whereas I need it to stop on the last image rectangle.png.

I have tried to alter the CSS making the column width set to auto but this did not work, and also the table width. How can I get round this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北座城市 2024-12-14 13:43:19

第一列的宽度为 3484px,矩形图像的宽度为 1134px。因此,即使您更改 CSS 中的宽度,最小也将是 4618px。 (大约是我当前屏幕宽度的 4 倍)。

Your first column have a width of 3484px and your rectangle image have a width of 1134px. So at minimun it will be 4618px even if you change the width in the CSS. ( about 4 times the width of my current screen).

柏林苍穹下 2024-12-14 13:43:19
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
#container {
width:100%; // set width to what you want
margin:0 auto; // if you want to center on page
    }

</style>
</head>

<body>
<div id="container">
<table width="5964" border="0" cellspacing="13">
<tr>
<td width="3484"><img src="images/square.jpg" width="850" height="534" /
<img src="images/circle.jpg" width="850" height="534" /></td>
<td><img src="images/rectangle.png" width="1134" height="534" /></td>
</tr>
</table>
</div>
</body>

试试这个,看看它是否对您有帮助,如果您的内容包含在屏幕中,它应该有助于滚动。我过去用这种方法解决了同样的问题。希望它能帮助好运。

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
#container {
width:100%; // set width to what you want
margin:0 auto; // if you want to center on page
    }

</style>
</head>

<body>
<div id="container">
<table width="5964" border="0" cellspacing="13">
<tr>
<td width="3484"><img src="images/square.jpg" width="850" height="534" /
<img src="images/circle.jpg" width="850" height="534" /></td>
<td><img src="images/rectangle.png" width="1134" height="534" /></td>
</tr>
</table>
</div>
</body>

Try this and see if it helps you if you have your content contained within the screen it should help with scrolling. I have solved the same problem in the past this way. Hope it helps good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文