【问题标题】:I'm trying to remove the scroll from the page, I do not understand what I'm doing wrong我正在尝试从页面中删除滚动,我不明白我做错了什么
【发布时间】:2018-06-19 02:34:31
【问题描述】:

我希望页面看起来像第二张图片。我认为通过溢出来隐藏图片的其余部分就足够了

这是结果:

这就是我想要的

.bgMentor{
	height: 100%;
	width: 100%;
	overflow:hidden;
	position:absolute;

  }
  
  .bgMentor img{
  	min-width: 100%;
	min-height: 100%;
	position: absolute;
	top:50%;
	left: 50%;
	transform: translate(-50%,-50%);
	width: auto;
	height: auto;
  }
<div class="bgMentor">
	    		<img class="img-responsive" src="{{Storage::url('img/getamentor.png')}}"> 
	    	</div>

【问题讨论】:

  • 您需要提供运行代码的链接。
  • This 可能会有所帮助。

标签: html css


【解决方案1】:

尝试使用overflow-y: hidden; 而不仅仅是overflow:;。如果这不起作用,请尝试将&lt;Img&gt; 直接放在正文中并使用class=“bgMentor” 对其进行样式化。

【讨论】:

    【解决方案2】:

    尝试为您的位置添加一个顶部和左侧值:绝对元素

    .bgMentor{
        height: 100%;
        width: 100%;
        overflow:hidden;
        position:absolute;
    
    
        top: 0;
        left: 0;
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-06
      • 2013-05-11
      • 1970-01-01
      • 2013-06-12
      • 2012-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多