html - 在不改变响应 View 的情况下将图像移动到顶部

标签 html css

你好,我想在浏览器调整大小时将图像移动到顶部而不改变响应 View ,我不知道轮播或列或两者的边距是否有问题,我移动图像这段代码

#img1{ 

    padding-top: 10px;
    width: 65%;
    margin: auto;
    display: block;
    padding-bottom: 50px;
    background-size: auto 0;


}

但是响应 View 正在改变,这是我的 css 代码和 html 代码。

@media (orientation: landscape) { 
    .carousel-item.active,
    .carousel-item-next,
    .carousel-item-prev {
        display: block;
        width:100%;
        height:96vh;
    }
}


.carousel .carousel-inner img {
  width: 100%;
  height: 30em;
  object-fit: cover;
  overflow: hidden;
}


.carousel-item.active img {
  width:300%;
}


.carousel-control-next-icon{
    background-image:url('imagenes2/arrow next.png');
}

.carousel-control-prev-icon{
    background-image:url('imagenes2/previous arrow.png');
}


 .d-block.img-fluid  {
    max-height: 100%;

}



.fila2 .carousel-inner  img { 
  max-width: 100%; 
  border-bottom: 2px solid rgb(0,171,235);
  border-left: 2px solid rgba(178,205,73,1.00);
  border-right: 2px solid rgba(178,205,73,1.00);


}

.carousel-control-prev{
    max-width: 100%;
    max-height: 75.5%;
    border-left: 2px solid rgba(178,205,73,1.00);
}

.carousel-control-next{
        max-width: 100%;
    max-height: 75.5%;

    border-right: 2px solid rgba(178,205,73,1.00);
}

这是我的轮播html代码

<div class="row fila2">
<!----inicio columna 2----->                <div class="col-12 imagenesc">

<!----inicio carousel----->      <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">

<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid" src="imagenes/20130819180556.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="imagenes/20130819180644.jpg" alt="Second slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a>

<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Nextborder</span> </a><!----fin carousel----->      </div>

</div>
</div>

<div class="row">
<div class="col-md-4">
<div id="img1">
<img  src="imagenes2/prueba.png" class="img-fluid">
</div>
</div>
</div>



</div>

这是一个screenshot我的网站,我想在不改变响应 View 的情况下将图像移动到顶部

thi is the responsive view

最佳答案

您能否提供 html 文件的完整源代码,以便读者可以通过正确的库和文件查看您的问题?

似乎还有另一个定位信息来源阻止相关图像到达顶部。

关于html - 在不改变响应 View 的情况下将图像移动到顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46551288/

相关文章:

html - Bootstrap 3 网格系统

html - 水平 div 对齐

html - 将特定的 CSS 类应用于具有特定 CSS 类的第二个 Span

javascript - 找不到带有排除模板 JAVA + Spring 的 CSS 和 JS 文件

html - Bootstrap - 为反向行模式创建移动自适应

python - DataFrame - 来自嵌套字典的表中的表

html - 使用 css 垂直格式化输入和标签标签

html - .svg 中的 <g> 元素不会在 :hover (css) 上放大

html - 如何为 Bootstrap 3 事件类设计样式

html - 两个背景图像之间的空间