html - 如何使用 Font Awesome 图标在另一个之上

标签 html css bootstrap-4 font-awesome

我是网络开发新手。我有一张 table ,

enter image description here

现在我正在使用

<th scope="col">Total Resumes<i className="fa fa-fw fa-sort sort-icon" onClick={() => props.sortCountAndScoreAscending('resumeCount')}></i></th>

现在,我尝试使用两个 fa 图标,

<th scope="col">Technology
                <i className="fa fa-sort-asc sort-icon" onClick={(event) => props.sortAscending(event, 'technology')}>
                </i>
                <i className="fa fa-sort-desc sort-icon" onClick={(event) => props.sortAscending(event, 'technology')}>
                </i>
            </th>

但它给了我

enter image description here

那么,如何获得第一张图片中的那个呢?

使用解决方案后

enter image description here

我所做的是

<th>
 <div className="d-inline-flex flex-column">
      <i className="fa fa-angle-up sort-icon" aria-hidden="true" onClick={() => props.sortData(props.type)}></i>
      <i className="fa fa-angle-down sort-icon" aria-hidden="true" onClick={() => props.sortData(props.type)}></i>
    </div>
</th>

最佳答案

包裹你的<i> s 放在 div 中,并为该 div 设置以下样式:

display: inline-flex;
flex-direction: column;

关于html - 如何使用 Font Awesome 图标在另一个之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55015444/

相关文章:

html - div 中的 Bootstrap 中心文本

javascript - Twitter 引导向导 TypeError : container is undefined

html - Bootstrap 4 : Navbar with logo and 2 rows

javascript - jQuery ajax 返回图像数据,但其他 JS 代码不再可见

javascript - 具有不同选择值的两个 HTML 选择

html - 图像不会与下拉菜单中的文本对齐

html - Bootstrap 4 网格布局不适用于 dompdf

php - 我应该如何在我的网站上创建访客帐户页面?

android - 如何在 android 中使用 Jsoup 从新闻帖子中提取图像并加载到 imageview 中?

HTML5 和 CSS3 在元素焦点上显示表单提示