gpt4 book ai didi

jquery - 在动态生成的按钮中垂直对齐 fa-icon

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

我正在使用 jquery 动态生成一个按钮并在其中添加一个 fa-icon,我需要垂直对齐该图标,因为该按钮包含两行字符串。代码:

$('#divContent').after('<center><button type="button" id="btnFiltersSave1" class="btn bg-green btn-sm"><i class="fa fa-2x fa-refresh"></i>&nbsp;&nbsp;No Filter added to this category<br/>Sync with Feature?</button></center>');

生成的按钮如下所示:

enter image description here

我希望它看起来像这样:

enter image description here

我该怎么做?可能吗?

最佳答案

CSS:

div{
position: absolute;
top: 15px;/**or requried**/
}

并添加父div相对位置

关于jquery - 在动态生成的按钮中垂直对齐 fa-icon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29203988/

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