gpt4 book ai didi

php - super 奇怪的 HTML 搞砸了

转载 作者:太空宇宙 更新时间:2023-11-03 20:02:00 24 4
gpt4 key购买 nike

我有一个评论系统,它通过向 SQL 数据库添加一行来工作。无论如何,这行得通,但是当我回显评论时,div 变得一团糟。无论如何,这是它所在的页面:http://learntc.net/index.php .

PHP:

while($row = mysql_fetch_array($result))
{
if ($count==1)
{
$bg == "33383C" ;
$count = 0;
}
echo "<div style='background-color: $bg; border: 1px soild silver;' class='comment'>";
echo "<div class='imageAndName'>";
echo "<img src='". $row["image"] ."' class='cPic'/>";
echo "<div class='UserLink'><a href='" . $row["page"] . "'>" . $row["username"] . "</a></div>";
echo "</div>";
echo "<div class='textStuff'>";
echo "<div class='post'>" . $row["comment"] . "</div>";
echo "<div style='color: gray; font-size: 8px'>" . $row["date"] . "</div>";
echo "</div>";
echo "</div>";

$bg = "#282C2F";
$count = $count + 1;
}

CSS:

.comments{
float: right;
padding: 10px;
width: 50%;
border: 1px solid #454D53;
}
.cPic{
width: 60px;
height: 60px;
}
.imageAndName{
width: 30%;
overflow: hidden;
float: left
}
.imageAndName a{
display: block;
}
.textStuff{
width: 70%;
float: right;

}
.post{
overflow: hidden;
width: 100%;
}
.comment{
padding-bottom: 5px;
}

最佳答案

clear: both 添加到您的 .comment 样式中。

关于php - super 奇怪的 HTML 搞砸了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12031416/

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