使用CSS创建
问题描述:
实现页面上的图像时
径向图像,我希望把他们转了一圈像使用CSS创建
但其默认形式为矩形。我想改变他们的形式为一个圆圈。 例:
<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">
我怎样才能做到这一点?
答
添加边框半径应你的要求。
img{
border-radius: 100%;
}
<img src="https://placeimg.com/128/128/animals?t=1513587750720"/>
答
最简单的方法
img {
border-radius: 50%;
}
答
你需要给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">
边界半径! – moped
你是什么意思上传图片? – 2017-12-18 09:02:26
@Highdef对不起,我更新了我的问题 – peterHasemann