gpt4 book ai didi

javascript - 图标未右对齐

转载 作者:行者123 更新时间:2023-11-30 09:18:14 25 4
gpt4 key购买 nike

我正在使用 bootstrap Accordion ,我想在链接的右边有一个箭头,但是用 text-right 将文本右对齐是行不通的。你知道为什么吗?您还知道如何切换 <i class="fa fa-arrow-right"></i> 中的超棒字体吗?至 <i class="fa fa-arrow-down"></i>当用户点击链接时?

示例:http://jsfiddle.net/921bdzsu/

HTML:

<div class="container py-5">
<div class="row">
<div class="col">
<div class="accordion" id="accordionExample">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<a class="text-custom-blue-dark" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Title
</a>
<span class="ml-auto text-right"><i class="fa fa-arrow-right"></i></span>
</h5>
</div>

<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="card-body">
<p class="faq-answer">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

最佳答案

span 元素默认为 inline。所以它们占据了内容的确切宽度。您可以改用 div,但它会落在下一行。

您最好的选择是使用定位或 float 元素。但我觉得最干净的是使用 flex

.mb-0 {
display: flex;
justify-content: space-between;
}

http://jsfiddle.net/921bdzsu/18/

关于javascript - 图标未右对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53527252/

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