当图像太大以适合屏幕时,我想剪掉图像的边缘。
当屏幕足够宽以适合图像时
我想在屏幕边缘/红线处剪切图像。如果我将最大宽度设置为 100%,它只会将图像挤压在一起。这是图像的代码:
<div id="container">
<img src="ptable.PNG" style="height:400px;width: auto;margin: auto;float: left;">
</div>
最佳答案
您只需将 overflow:hidden
添加到您的容器中,它就会阻止图像通过它。
关于html - 在屏幕边缘裁剪图像html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35702536/