gpt4 book ai didi

css - 样式列表项,用 fontawesome 替换 bullet

转载 作者:太空宇宙 更新时间:2023-11-03 21:10:23 24 4
gpt4 key购买 nike

我必须创建一个这样的列表

enter image description here

我试图用 fontawesome 图标替换元素符号,但我得到的是这样的东西

enter image description here

请注意,两者之间存在间距差异。我的 CSS 是

.custom_list li {
line-height:2em;
padding-left:0px;
padding-top:5px;
padding-bottom:5px;
font-size:14px;
list-style-type:none;
list-style:none;
}
.custom_list li:before {
font-family: 'FontAwesome';
content: "\f192";
color: black;
margin-right:15px;
}

HTML 是

<ul class="custom_list" >
<li>Medical Student Education</li>
<li>Resident Training Education (Medicine, Osteopathic, Pharmacy)</li>
<li>Fellowship Training Education (all medical subspecialties)</li>
<li>Nursing Student Training Education</li>
<li>Nurse Practitioner Education</li>
<li>Nurse Continuing Education</li>
<li>Physician Continuing Medical Education</li>
</ul>

我做错了什么?

最佳答案

.custom_list li {
line-height:2em;
padding-left:0px;
padding-top:5px;
padding-bottom:5px;
font-size:14px;
list-style-type:none;
list-style:none;
display: table-row;
}
.custom_list li:before {
font-family: 'FontAwesome';
content: "\f192";
color: black;
margin-right:15px;
display: table-cell;
}

您需要将列表格式更改为表格

关于css - 样式列表项,用 fontawesome 替换 bullet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47440865/

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