【发布时间】:2020-08-04 14:06:42
【问题描述】:
我想像这样对齐我的引导 div:
我想要一个有边框的容器,里面有 3 个 div。我尝试了一整天,但使用引导程序无法弄清楚。
我的代码:
<?php
require "navigationbar.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<link rel="stylesheet" href="profi.css">
</head>
<body>
<div class="row" id="row">
<div class="col-md-3">
<div class="row">
<div class="col-md-12 medium">
title
<div class="row">
<div class="col-sm-12 small">
description
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
CSS
.small {
height: 50px;
border: 1px solid;
}
.medium {
width: 1800px;
height: 200px;
border: 1px solid;
}
.large {
height: 800px;
border: 1px solid;
}
#row {
width: 600px;
border: 1px solid;
height: 400px;
margin-left: 50px;
margin-top: 50px;
}
在我的代码中,当我尝试在.medium 中使用 CSS 时,它不会增加宽度,也不会改变其他任何东西的宽度。有人可以告诉我如何使用引导程序来做到这一点(与我绘制的第一张图片相同)?
【问题讨论】: