php - 阿凡达圆 Angular 问题

标签 php jquery css

我正在尝试找出执行以下操作的最佳方法: 假设我有一个颜色为 x 的圆圈,我想在其中放置头像,我的目标是使头像图像也变圆,以使结果看起来更好。

我可以使用 php-gd 来做到这一点,但可能需要做很多计算(除非我错过了一些 gd 函数),是否有更好或更快的方法来解决它,例如 css?

蒂亚

最佳答案

如果我是你,为了简单起见,我会使用 CSS3。下面将把图像变成一个圆形,并给它一个 1px 的圆形边框。

div.avatar{
    width:30px; height:30px; border:solid 1px #000;
    -webkit-border-radius: 16px; -moz-border-radius: 16px; border-radius: 16px;
}

div.avatar img{
    width:30px; height:30px;
    -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px;
}

<div class="avatar"><img src="" /></div>
  • 老版本的 IE 不支持 CSS3

关于php - 阿凡达圆 Angular 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8945174/

相关文章:

php - 从 github 克隆 laravel 项目

javascript - Raphael js,如何获取圆心的x、y位置?

html - 缩放页面时对齐问题

css - 获取由 <td> 分隔的 div 以获取表格行为

curl - file_get_contents 和 curl 都不起作用

php - PDO错误:SQLSTATE[42000]: Syntax error or access violation: 1064

javascript - .off 不适用于回调

c# - 如何在 Visual C# .NET Web 元素中添加对所有 Web 窗体的 CSS 样式表引用

php - Laravel 模型关系

jquery - grails gorm:格式化的数字和日期