我希望對齊我的文本,以便當我發送消息時,它顯示在左側,但它的回覆,文本顯示在右側......我不知道是否使用「文本 - 對齊:左「,位置或對齊。這裏是我的代碼php中的文本對齊方式
if ($row['username'] == $username)
{
$color = 'blue';
$align:left; // dont know if this is right
}
else
{
$color = 'red';
$align:right; // dont know if this is right
}
echo '<i><p style="font-family:arial;color:'.$color.';font-size:15px;"> <strong>' . $row['username']. '</strong>: ' . $mymessage.'</i></p>';
}
嘗試使用浮動:正確的或浮動:左 – Growler 2013-03-12 18:12:26
'$ align:left進行;'是不正確的PHP語句 – 2013-03-12 18:14:59
或產生特殊類在PHP代碼元素,並在CSS定義這個類。 – ZloyPotroh 2013-03-12 18:15:00