2017-12-18 83 views
-3
实现页面上的图像时

径向图像,我希望把他们转了一圈像使用CSS创建

Circle

但其默认形式为矩形。我想改变他们的形式为一个圆圈。

<p> 
 
Current: 
 
</p> 
 

 
<img src="https://cdn.discordapp.com/attachments/316916526760591362/392232736468762625/unknown.png"> 
 

 
<p> 
 
Desired: 
 
</p> 
 

 
<img src="https://cdn.discordapp.com/attachments/316916526760591362/392237925942951936/unknown.png">

我怎样才能做到这一点?

+3

边界半径! – moped

+0

你是什么意思上传图片? – 2017-12-18 09:02:26

+0

@Highdef对不起,我更新了我的问题 – peterHasemann

回答

2

添加边框半径应你的要求。

img{ 
 
    border-radius: 100%; 
 
}
<img src="https://placeimg.com/128/128/animals?t=1513587750720"/>

1

最简单的方法

img { 
    border-radius: 50%; 
} 
1

你需要给border-radius:50%img

img { 
 
width:100px; 
 
height:100px; 
 
border-radius:50%; 
 
}
<p> 
 
Current: 
 
</p> 
 

 
<img src="https://cdn.discordapp.com/attachments/316916526760591362/392232736468762625/unknown.png"> 
 

 
<p> 
 
Desired: 
 
</p> 
 

 
<img src="https://cdn.discordapp.com/attachments/316916526760591362/392237925942951936/unknown.png">