dongzhong1929 2014-06-01 14:33
浏览 13
已采纳

如何在PHP脚本中添加高度和宽度?

I have the following line. It works fine but I want to add height and width to the image. How?

echo "<td>" . "<img src='img/" .$row['Foto'] . "'>" . "</td>";
  • 写回答

1条回答 默认 最新

  • dousaoxiancy199896 2014-06-01 14:34
    关注

    You can use style attribute :

    echo "<td>" . "<img style = 'width:?;height:?' src = 'img/" .$row['Foto'] . "'>" . "</td>";
    

    or width and height attributes :

    echo "<td>" . "<img width = '?' height = '?' src = 'img/" .$row['Foto'] . "'>" . "</td>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?