Discuz!小编 发表于 2024-8-14 21:12:45

在discuz帖子列表使用调用用户头像,如何添加头像alt呢? 1金币 .anslist{background:url(source/plugin/keke_answer/template/images/coin.png) left center no-repeat;font-family:Microsoft Yahei; padding:2px 0px 2px 20px; margin:0px 0px 0px 10px; font-size:12px; color:#F30; text-decorati

我知道有写uc地址的方式来获取头像,我想问一下,使用调用用户头像在列表页,如何给头像图片添加alt呢
我知道答案 回答被采纳将会获得1 贡献 + 1 金币 已有2人回答

凡若尘 发表于 2024-8-14 21:13:00

<a href="home.php?mod=space&uid={$thread['authorid']}"><img src="<!--{avatar($thread['authorid'], 'small', true)}-->" alt="$thread['author']"></a>

海军大都督 发表于 2024-8-14 21:13:57

function avatar($uid, $size = 'middle', $returnsrc = 0, $real = FALSE, $static = FALSE, $ucenterurl = '', $class = '', $extra = '', $random = 0) {第八个参数你可与传入'alt=""'
页: [1]
查看完整版本: 在discuz帖子列表使用调用用户头像,如何添加头像alt呢? 1金币 .anslist{background:url(source/plugin/keke_answer/template/images/coin.png) left center no-repeat;font-family:Microsoft Yahei; padding:2px 0px 2px 20px; margin:0px 0px 0px 10px; font-size:12px; color:#F30; text-decorati