我有一个任务,需要使用HTML和BOOTSTRAP构建一个网站,但是我在侧边导航栏方面遇到了一些问题(代码如下所示)。为什么我的代码结果显示为两个块不是在同一行显示,而是一个接一个地显示。我使用了Bootstrap预定义类"d-inline-block",但是它只适用于第二个div元素中的段落短于一行的情况。我想将两个块分别放置在左侧和右侧,就像一个导航块和一个带有一些信息的右侧块。
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="container">
<div class="d-inline-block">
<ul class="list-group">
<li class="list-group-item">one</li>
<li class="list-group-item">two</li>
<li class="list-group-item">three</li>
<li class="list-group-item">four</li>
<li class="list-group-item">five</li>
</ul>
</div>
<div class="d-inline-block">
<h1>Lorem Ipsum</h1>
<p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
</body>
</html>