gpt4 book ai didi

html - 在 Bootstrap 中,如何让我的文本左对齐?

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

我希望“文本”与“关键文本”左对齐。目前它位于右侧:

l

我以为类 pl-0 会这样做,但事实并非如此。如何让“文本”与示例中的“关键文本”左对齐?我有以下 JSFiddle和片段:

.row {
background: #f8f9fa;
margin-top: 20px;
}

.col {
border: solid 1px #6c757d;
padding: 10px;
}
<script type="text/javascript" src="//code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<link rel="stylesheet" type="text/css" href="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script type="text/javascript" src="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

<div class="modal-content pl-3 pr-3">
<div class="modal-body">
<div class="modal-body-scrolled border-primary border-bottom p-0 mt-2">
<div class="form-row">
<label id="lblFieldName" class="col-5 mb-0 text-primary font-weight-bold">Key Text</label>
<div class="col-12">
<div class="row ml-0 mr-0">
<div class="row form-inline col-12 mt-2 mb-2 pt-2 pb-2 m-0">
<div class="row col-12 pl-0 pr-0 mb-2">
<label for="duration" class="col-2 pl-0">Text</label>
<div class="col-10 pl-0 d-inline">
<textarea class="form-control" rows="2"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

最佳答案

添加justify-content-start也上课——看下面的演示:

.row {
background: #f8f9fa;
margin-top: 20px;
}

.col {
border: solid 1px #6c757d;
padding: 10px;
}
<script type="text/javascript" src="//code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<link rel="stylesheet" type="text/css" href="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script type="text/javascript" src="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

<div class="modal-content pl-3 pr-3">
<div class="modal-body">
<div class="modal-body-scrolled border-primary border-bottom p-0 mt-2">
<div class="form-row">
<label id="lblFieldName" class="col-5 mb-0 text-primary font-weight-bold">Key Text</label>
<div class="col-12">
<div class="row ml-0 mr-0">
<div class="row form-inline col-12 mt-2 mb-2 pt-2 pb-2 m-0">
<div class="row col-12 pl-0 pr-0 mb-2">
<label for="duration" class="col-2 pl-0 justify-content-start">Text</label>
<!-- ADDED 'justify-content-start' -->
<div class="col-10 pl-0 d-inline">
<textarea class="form-control" rows="2"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

关于html - 在 Bootstrap 中,如何让我的文本左对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55527424/

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