iPhone SE纵向模式上的Bootstrap Carousel图像未居中(其他图像)

时间:2017-08-13 03:15:54

标签: jquery html css iphone twitter-bootstrap

以下是网站:http://sdgsdgsdgsdg.atwebpages.com/

在桌面浏览器上以任何比例工作。如果处于横向模式,也可以在移动设备上使用。

但是,在我的iPhone SE上使用纵向模式时,第一个旋转木马图像在Chrome中偏离中心。

这是截图:

enter image description here

我尝试将text-align:center的样式添加到旋转木马中的特定图像的div中,但它没有用。

编辑:正如前面的答案应该解决的那样,我使用了添加到我的css的答案中的代码:.carousel-inner> .item> img {     保证金:0自动; }

它仍然没有用。

有什么想法吗?

2 个答案:

答案 0 :(得分:1)

你现在正在使用这种风格

.unity-logo > img {
    width: auto;
    height: 386px;
    max-height: 386px;
    margin: 0 auto;
}

只需覆盖媒体查询中的上述风格。

@media only screen and (max-width:479px){
   .unity-logo > img {
      width:100%;
      height:auto;
    }
}

它应该有用..

enter image description here

答案 1 :(得分:0)

这就是你需要的:

@media(max-width:480px){
  .unity-logo > img{
     max-width: 100%;
     height: auto;
    }
}

希望它有所帮助:)