页面垂直填满时换行

时间:2017-01-25 06:54:03

标签: html css twitter-bootstrap-4

我的页面中有很多Bootstrap 4卡。

我希望在出现垂直滚动条时插入换行符。我怎么能这样做?

代码:

<?php
//THIS FILE IS A PART OF CROPSATH, LICENSED UNDER GPLv3.
//MADE BY MORICZGERGO A.K.A. SKIILAA
//CREATED: 2017.01.22.
//LAST MODIFIED: 2017.01.22.

include_once "include.php";

$conn = new mysqli($config->sqlServ, $config->sqlUser, $config->sqlPass, $config->dbName);

if ($conn->connect_error){
  echo "<center><h1>Failed to connect to database.</h1></center>";
  echo $conn->connect_error;
  die();
}

$sql = "SELECT questionName FROM questions ORDER BY id DESC";
$result = $conn->query($sql);

if ($result->num_rows > 0){
  echo "<div class=\"responsive-thingy\">";
  //output data of each row in bootstrap cards
  while($row = $result->fetch_assoc()) {
echo "<div class=\"card\" style=\"width: 20rem; display: table-cell;\"><div class=\"card-block\"><h4 class=\"card-text\">" . $row["questionName"] . "</h4></div></div>";
  }
  echo "</div>";
} else {
  echo "<center><h1>No questions found.</h1></center>";
}
?>

GitHub Repo

1 个答案:

答案 0 :(得分:0)

如果是您正在谈论的文字,您可以使用css中的“hyphens