Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.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
Html 如何降低旋转木马滑块中的图像高度_Html_Css_Bootstrap 4 - Fatal编程技术网

Html 如何降低旋转木马滑块中的图像高度

Html 如何降低旋转木马滑块中的图像高度,html,css,bootstrap-4,Html,Css,Bootstrap 4,如何在引导中降低转盘幻灯片中的图像高度,但降低图像高度后必须具有响应能力 <div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div class="carousel-item activ

如何在引导中降低转盘幻灯片中的图像高度,但降低图像高度后必须具有响应能力

<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
    <div class="carousel-inner">
        <div class="carousel-item active">
            <img src="images/xactprofile1.png" class="d-block w-100 d-inline-block" alt="..." />
        </div>
    </div>
</div>

试试这个。在此基础上尝试降低高度时,它会改变高度。将其添加到您的图像中

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
img {
  width: 100%;
  height: auto;
}
</style>
</head>
<body>

<img src="img_chania.jpg" width="460" height="345">
<p>Resize the browser window to see how the image will scale.</p>

</body>
</html>

img{
宽度:100%;
高度:自动;
}
调整浏览器窗口的大小以查看图像的缩放方式


更改
.carousel内部高度是否可以解决您的问题?或者这不是你想要的?因为您可以使用例如
height:50vh
,它也会改变图像,但整个内部都会受到影响。图像将保持响应性

查看此代码段:

CSS:

.carousel内部{
高度:50vh;
}


  • 它可以工作,但问题是它的响应性不好(检查)。因此,请根据移动设备中的屏幕分辨率更改图像@mohammednabilI的高度和宽度。它看起来非常有弹性。请尝试拍摄质量良好的图像,并相应地设置高度@mohammednabil