轮播幻灯片中的图像大小相同

时间:2018-08-02 08:39:58

标签: javascript html5 carousel

我有一个滑块:http://sakura-city.info/test

问题在于,即使更改图像时,滑块的高度也会发生变化,尽管它是在标签中进行了硬编码的事实。

splitted = df.Name.str.split('.\s+', n=1)
df['first_Name'] = splitted.str[0]
df['Last_Name'] = splitted.str[-1]
print (df)
             Name first_Name     Last_Name
0         P. John          P          John
1           Merry      Merry         Merry
2  P. John travis          P   John travis

3 个答案:

答案 0 :(得分:0)

.item类中添加一些css,以设置高度相等的cs,我是using height:200px

.item{ height:200px;}

还要在此处添加封面图片完整框的css,例如我在.item img中添加css

.item img {
width: 100%;
height: 100% !important;
object-fit: cover;}

答案 1 :(得分:0)

您的图像具有不同的高度。因此,您会看到这种行为。

为.item div添加固定高度

.carousel-inner>.active {
  height: 150px; //this can be whatever you want
}

并从图像中删除 height =“ 200” 属性。

答案 2 :(得分:0)

删除硬编码的宽度和高度并将其放入样式表

.carousel-inner>.item>img, .carousel-inner>.item>a>img{
height:150px;
}