gpt4 book ai didi

php - php中的文本对齐

转载 作者:行者123 更新时间:2023-12-01 00:51:22 24 4
gpt4 key购买 nike

我想对齐我的文本,这样当我发送消息时,它出现在左边,但它是一个回复,文本出现在右边......我不知道是否使用“text-align:left ",定位或对齐。这是我的代码

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>';

}

最佳答案

设置它的方式与设置颜色的方式完全相同。

例如:

$align='right';

echo '<i><p style="font-family:arial;color:'.$color.';text-align:'.$align.';font-size:15px;"> <strong>' . $row['username']. '</strong>: ' . $mymessage.'</i></p>';

关于php - php中的文本对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15368883/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com