gpt4 book ai didi

css - 使用 CSS 居中 Bootstrap 内容

转载 作者:太空宇宙 更新时间:2023-11-04 15:26:45 26 4
gpt4 key购买 nike

当浏览器宽度最大化时,我试图使受 Bootstrap 启发的网格(下面的 Fiddle)的内容居中。我想在他们的屏幕上看到 4 和 5 block 居中。我可以应用什么 CSS 来实现这一目标?

<!DOCTYPE html>
<html lang="en">
<head>
<title>Scaffolding · Bootstrap</title>
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
<link href="http://twitter.github.com/bootstrap/assets/css/docs.css" rel="stylesheet">
</head>
<body>
<div class="row">
<div class="span9">
<div class="row show-grid">
<div class="span4">
4</div>
<div class="span5">
5</div>
</div>
</div>
</div>
</body>
</html>

Fiddle

最佳答案

为您的body 标记类container。这应该使 div 与类 row 居中。

<body class="container">

关于css - 使用 CSS 居中 Bootstrap 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13923403/

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