dsbqfrr098575666 2013-05-13 21:27
浏览 22
已采纳

如何在变量中设置图像样式? [关闭]

I have an image being pulled out of a forum (avatars), but every time i grab them, they are not fitting my div, no matter what i do, i'm wondering how can i fit that image inside my div?

Here's the line i'm talking about:

<div id="image">'.$ipbwi->member->photo($friend['friends_friend_id']).'</div>

And here's a whole foreach:

<?php
$friends = $ipbwi->member->friendsList(false,true);
foreach($friends as $friend){
echo '
<div class="friend">
<div id="image">'.$ipbwi->member->photo($friend['friends_friend_id']).'</div>
<div class="username">'.$ipbwi->member->id2displayname($friend['friends_friend_id']).'</div>
</div>
';
}
?>

I'm using ipbwi to pull data from ipb forum and i would like to scale all the images to (example) 40x40px.

Edit:

here's the css i'm using for img on div: #friend #image img{width: 40px; height: 40px;}

Thanks in advance!

  • 写回答

3条回答 默认 最新

  • dtqqq24248 2013-05-13 21:33
    关注

    try adding the style rule

    .friend img { max-width:100px; max-height:100px }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法
  • ¥15 八路抢答器设计出现故障
  • ¥15 opencv 无法读取视频
  • ¥15 按键修改电子时钟,C51单片机