图像填充和居中圆形

时间:2015-08-04 04:27:13

标签: html css image geometry

我试图让我的图像居中并填充圆形(不拉伸图像)。目前我只占用了半圈的图像。 您可以在此处查看我的网站 - http://anglican.koru.firebrand.co.nz/

图片将由客户上传,因此我无法拥有'背景图片'在css中,因为它会不断变化。

由于

3 个答案:

答案 0 :(得分:0)

因为您在图片中添加了max-width,因此图片会适合圆宽。

删除max-width并添加

max-height: 100%; // this is for fit the height of image to circle
margin-left: -50%; // this is for centering the image

.img-responsive

答案 1 :(得分:0)

height:auto

更改为height: 100%;.img-responsive
.img-responsive {
      display: block;
      max-width: 100%;
      height: 100%;  //changed this
    }

答案 2 :(得分:-1)

max-width:100%;课程中删除.img-responsive,然后获取圈子。

相关问题