如何在 PHP 中对齐我的图片旁边的文本

How to align text next to my Image in PHP

我希望我网站上照片上方的文字位于图像旁边的右侧。我试图这样做,但格式一定是错误的。谁能引导我朝着正确的方向前进。谢谢

如下更改元素顺序,并将 float:left; css 添加到 .detail-broker (最好不要像我在下面所做的那样内联)。我相信 php 代码仍然有效,但只需仔细检查它是否有效。

<?php
if($configClass['show_agent_details'] == 1){ ?>
  <h4>Contact Your Consultant</h4>
  <div class="detail-broker" style="float:left;">
  <?php echo $row->agentphoto;?>
    <div class="broker-name">
      <b><a href="<?php echo JRoute::_("index.php?option=com_osproperty&task=agent_info&id=".$row->agent_id);?>"><?php echo $row->agent_name;?></a></b>
    </div>
  </div>

  <?php
  //echo("<div align='right'>");
  echo("Phone: <a href='tel:1300791719'>1300 791 719</a><br />");
  echo("Email: <a href='mailto:info@newrealestate.properties'>info@newrealestate.properties</a><br />");
  echo("Address: Level 4, 150 Albert Rd, South Melbourne, 3205, Melbourne, Victoria");
  //echo("</div>");
  ?>


<?php } ?>