html - 从溢出图像 CSS 中删除多余的空格

标签 html css

我试图让图像的溢出看起来隐藏在特定屏幕尺寸上,但我无法找到为什么会出现这种额外间距的解决方案。这是我目前拥有的 html 和 css。我正在尝试这样做,因为图像会显得太小。

也欢迎 Bootstrap 解决方案。

.aboutsplash img{
	width: 100%;
	height: auto;
	margin: 0;
}
@media (max-width: 769px){
	.aboutsplash img{
	overflow: hidden;
	width: auto;
	max-height: 150px;  
	}
}
@media (max-width: 500px){
	.aboutsplash img{
	position: left;
	margin: 0 0 0 -25%;
	}
}
<div class="aboutsplash">
    <img src="images\sunsetcrop2.jpg" alt="lbl sunset">
</div>

enter image description here

最佳答案

  @media (max-width: 769px){
    .aboutsplash {
      overflow: hidden;
    }
  }

试试这个。

关于html - 从溢出图像 CSS 中删除多余的空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45834248/

相关文章:

html - PC 到 PC 的 CSS 宽度问题

css - 为什么 CSS 没有应用于 IE 中的文本框?

html - 带有侧翼渐变的居中图像不适用于所有浏览器

html - 搜索栏样式出现在本地但不在 heroku 上

css - 编写 Sass 函数的正确方法是什么?

css - 有没有办法覆盖 `overflow` 的内联 CSS?

html - 如何使 CSS Sprites 垂直对齐移动设备

html - 是否邮寄到 : in anchor tag actually support attachments?

jquery - 添加一个类并限制html的数量

html - paypal不收运费?