佘翠茵 发表于 2024-8-29 15:49:07

在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 金币最佳答案

      

郁和静 发表于 2024-8-29 15:49:39



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

黎世敏 发表于 2024-8-29 15:50:34

function avatar($uid, $size = 'middle', $returnsrc = 0, $real = FALSE, $static = FALSE, $ucenterurl = '', $class = '', $extra = '', $random = 0) {第八个参数你可与传入'alt=""'

淤芯咬 发表于 2024-8-29 15:50:59

非常感谢,你的帮助,很工整。
页: [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