我正在嘗試創(chuàng)建一個評論系統(tǒng),用戶可以在其中發(fā)表評論,然后其他用戶可以回復(fù)這些評論。我希望實際帖子位于頁面左側(cè),評論位于右側(cè),這樣用戶就不必滾動瀏覽實際帖子來閱讀評論。我試過使用 position: absolute ,但這會干擾我的回復(fù)系統(tǒng)。有誰知道一個更簡單的方法來做到這一點?我的代碼while ($commentrow = mysqli_fetch_assoc($commentresult)) { if (mysqli_num_rows($commentresult)==0) { echo ''; } else { $commenterid = $commentrow['userid']; $commentersql = "SELECT * FROM users WHERE userid = '$commenterid'"; $commenterresult = mysqli_query($conn, $commentersql); while ($commenterrow = mysqli_fetch_assoc($commenterresult)) { echo '<div class="PostComments">'; if ($commenterrow['profileimg'] == 1) { $filename = "profilepics/profile".$commenterid."*"; $fileinfo = glob($filename); $fileext = explode(".", $fileinfo[0]); $fileactualext = $fileext[1]; echo "<div class='CommentProfilePicture'><img src='profilepics/profile".$commenterid.".".$fileactualext."?".mt_rand()."'></div>"; } else { echo "<div class='CommentProfilePicture'><img src='profilepics/noUser.png'></div>"; } echo "<div class='CommentUserName'>".$commenterrow['userName']."</div>"; echo "<div class='CommenterComment'>".$commentrow['comment']."</div> </div>"; }如果您有任何問題,我將非常樂意為您解答。
如何在保留回復(fù)的同時移動我的評論?
慕桂英3389331
2021-07-02 10:11:01