php - 指定由 PHP 文件调用的图像宽度和高度

标签 php html css

我想找出在哪里指定 facebook.png 的图像大小,即 24x24。

下面是代码,但我不确定如何指定大小。我知道如何在 HTML 中执行此操作,但在 PHP 中不知道。

<?php if ( get_option('solostream_facebook_url') ) { ?>
    <a title="<?php echo stripslashes(get_option('solostream_facebook_link_text')); ?>" rel="external" href="http://www.facebook.com/<?php echo stripslashes(get_option('solostream_facebook_url')); ?>"><img class="facebook-sub" src="<?php bloginfo('template_directory'); ?>/images/facebook.png" alt="<?php echo stripslashes(get_option('solostream_facebook_link_text')); ?>" align="top" /></a>
<?php } ?>

最佳答案

添加 heightwidth <img> 的属性.检查下面的代码。

<?php if ( get_option( 'solostream_facebook_url') ) { ?>
<a title="<?php echo stripslashes(get_option('solostream_facebook_link_text')); ?>" rel="external" href="http://www.facebook.com/<?php echo stripslashes(get_option('solostream_facebook_url')); ?>"><img class="facebook-sub" src="<?php bloginfo('template_directory'); ?>/images/facebook.png" alt="<?php echo stripslashes(get_option('solostream_facebook_link_text')); ?>" align="top" height="24" width="24"/></a>
<?php } ?>

关于php - 指定由 PHP 文件调用的图像宽度和高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36544736/

相关文章:

php - 使用mysqli时如何不显示重复错误

php - 如何在一个查询中更新多行(使用 for 循环)

c# - 如何在unity3d中加载一个html网页

php - Firebug 显示位于 "wp-login.php #3 (line 25)"中的 CSS 源代码。找不到这个文件

javascript - 具有流畅运动的CSS动画关键帧

php解析汇率提要XML

php - 选中所有必需的单选按钮后启用按钮

php - 将 HTML 站点移动到 PHP

html - 未对齐的 CSS 布局 - 具有固定中心的 3 col 布局

html - DIV列表链接拒绝触摸