Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何创建一个水平滚动条来查看图像的其余部分?_Php_Html_Css_Web - Fatal编程技术网

Php 如何创建一个水平滚动条来查看图像的其余部分?

Php 如何创建一个水平滚动条来查看图像的其余部分?,php,html,css,web,Php,Html,Css,Web,这是我的图片的代码,问题是图片太大了,页面被剪切掉了。我想要一个水平滚动条。我想知道制作水平滚动条的代码是什么,这样我就可以看到图像的其余部分。我不想调整图像的大小,只是为了能够水平滚动。我知道一个奇怪的想法。非常感谢您的帮助。您可以这样做:将图像放置在具有给定尺寸的div中,然后将div上的overflow属性设置为滚动。它看起来像这样: HTML: 希望这有帮助。此外,我建议使用CSS而不是HTML设置图像的高度和宽度 <div class="img-container&qu


这是我的图片的代码,问题是图片太大了,页面被剪切掉了。我想要一个水平滚动条。我想知道制作水平滚动条的代码是什么,这样我就可以看到图像的其余部分。我不想调整图像的大小,只是为了能够水平滚动。我知道一个奇怪的想法。非常感谢您的帮助。

您可以这样做:将图像放置在具有给定尺寸的div中,然后将div上的overflow属性设置为滚动。它看起来像这样:

HTML:

希望这有帮助。此外,我建议使用CSS而不是HTML设置图像的高度和宽度

<div class="img-container">
  <img src="the fake.png" width="3268" height="538" class="table" alt=""/>
</div>
.img-container{
width: 500px; /*width of the container the image is in, your choice*/
height: auto; /*means the height of the container is the same as the image so you are not scrolling vertically*/
overflow-x: scroll; /*this is the important line that tells the browser to scroll content outside the div*/
}