页面中的两个独立部分

时间:2015-09-21 14:19:22

标签: php html

我想制作两个不同的部分,以便在右侧显示图像,在左侧显示一些代码。

以下是您理解的代码

<h2><?php echo $data['user'] ?> - Profile Page</h2>
<center><p id ="greet" align="left">Next Generation Gaming - <?php echo $title ?></p></center>
<p><center align="right"><img src='images/skins/<?php echo $data['SavSkin'] ?>.png' width="580" height"110"> </center></p>

<p id ="greet"><?php echo "Banned : ".$pban ?></p>
<p id ="greet">Money : <?php echo $data['money'] ?></p>
<p id ="greet">Banked : <?php echo $data['Bank'] ?></p>
<p id ="greet">Kills : <?php echo $data['kills'] ?></p>

<p class='text-alert' id ="greet">Kill Death Ratio : <?php
$kd = $data['kills'] / $data['deaths']; echo round($kd, 2); ?>
</p>

<p id ="greet">Admin Kills : <?php echo $data['AdminKills'] ?></p>
<p id ="greet">Cookies : <?php echo $data['cookies'] ?></p>
<p id ="greet">Cakes : <?php echo $data['cakes'] ?></p>
<p id ="greet">Biscuits : <?php echo $data['biscuits'] ?></p>
<p id ="greet">Icecreams : <?php echo $data['icecreams'] ?></p>
<p id ="greet">Race Won : <?php echo $data['RaceWon'] ?></p>
<p id ="greet">Quiz Won : <?php echo $data['ReactionTestWon'] ?></p>
<p id ="greet">Command Used : <?php echo $data['TotalCmdsUsed'] ?></p>
<p id ="greet">Total Warnings : <?php echo $data['TotalWarnings'] ?></p>
<p id ="greet">Total Logins : <?php echo $data['TotalLogins'] ?></p>
<p id ="greet">Registered Date : <?php echo $data['RegisteredDate'] ?></p>
<p id ="greet">Last Login : <?php echo $data['LastOnlineDate'] ?></p>

在第二个像你可以看到我添加了一个图像

<p><center align="right"><img src='images/skins/<?php echo $data['SavSkin'] ?>.png' width="580" height"110"> </center></p>

我想要做的是让图像显示在页面的右侧,其余部分显示在左侧。 通过什么方式可能?

1 个答案:

答案 0 :(得分:0)

您可能想要使用一些CSS

重写

<p><center align="right"><img src='images/skins/<?php echo
 $data['SavSkin'] ?>.png' width="580" height"110"> </center></p>

作为

<div style="float:right;"><img src="images/skins/<?php echo $data['SavSkin'] ?>.png" width="580" height"110" /></div>