gpt4 book ai didi

html - 显示 :inline-block isn't working

转载 作者:行者123 更新时间:2023-11-28 05:13:13 25 4
gpt4 key购买 nike

.test,
.test2 {
display: inline-block;
}
<div class="container">
<div class="row">

<div class="test">
<button type="button" class="btn btn-success">Success</button></div>

<div class="test2">
<span>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta odit omnis maiores quis, tempore ut dolorum iure, nesciunt dolores laboriosam cumque praesentium blanditiis porro repellat numquam. Ducimus, dolores atque accusantium!
</span>
</div>

</div>
</div>

http://jsfiddle.net/x1hphsvb/6270/

我有两个 div,我想将它们并排放置。

最佳答案

为此将 display: flex; 添加到 .row

http://jsfiddle.net/x1hphsvb/6277/

.test, .test2 {
display: inline-block;
}
.row {display: flex;}
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">

<div class="test">
<button type="button" class="btn btn-success">Success</button></div>

<div class="test2">
<span>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta odit omnis maiores quis, tempore ut dolorum iure, nesciunt dolores laboriosam cumque praesentium blanditiis porro repellat numquam. Ducimus, dolores atque accusantium!
</span>
</div>

</div>
</div>

To know more about display property - https://www.w3schools.com/cssref/pr_class_display.asp

关于html - 显示 :inline-block isn't working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51206544/

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