我目前正在嘗試制作一個(gè)博客。當(dāng)我嘗試對(duì)帖子正文進(jìn)行“預(yù)覽”時(shí)。第一篇文章似乎沒(méi)問(wèn)題,但第二篇文章超出了它的 div。我嘗試更改要使用的標(biāo)簽和 css 格式,但它仍然如此。我的代碼:超文本標(biāo)記語(yǔ)言<div class="module"> <div class="blog"> <div class="recents"> <h2>Recent Posts</h2> <br><br> <?php $sql = "select title, body, created_at FROM posts"; $result = mysqli_query($link, $sql); $query = mysqli_query($link, $sql) or die(mysqli_error($link)); while ($row = mysqli_fetch_assoc($query)) { $title = $row['title']; $body = $row['body']; $created_at = $row['created_at']; if (strlen($body) > 500) { $body = substr($body, 0, 500); } echo "<h3>" . $title . "</h3><br>"; echo "<p>" . $body . "</p>"; echo "<small>" . $created_at . "</small>"; echo "<br><br>"; } ?> </div> <div class="categories"> <h3>Categories</h3> </div> </div>CSShtml { font-family: 'IBM Plex Serif', serif;}.module { background-color: #fffff7; box-shadow: 3px 10px 18px #888888; padding-top: 70px; padding-left: 130px; border: 1px solid; width: 1080px; margin-left: 380px; height: 821px;}.blog { display: flex; flex-direction: row; text-align: left;}.recents { flex-grow: 2; width: 570px;}.categories { flex-grow: 1;}任何幫助,將不勝感激。
1 回答

Smart貓小萌
TA貢獻(xiàn)1911條經(jīng)驗(yàn) 獲得超7個(gè)贊
這是因?yàn)闆](méi)有空格
要解決此問(wèn)題,請(qǐng)嘗試以下操作:
word-wrap: break-word;
- 1 回答
- 0 關(guān)注
- 142 瀏覽
添加回答
舉報(bào)
0/150
提交
取消