我正在试着让字体很棒的图标看起来更纤细https://jsfiddle.net/cliffeee/7L6ehw9r/1/。
我试着使用‘-webkit-text- see’,但当鼠标悬停在图标上时没有帮助,因为你可以看到背景颜色,我不希望它被看到。
.accordion-toggle {
background-color: #777;
color: white;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
}
.collapsed, .accordion-toggle:hover {
background-color: #555;
}
.accordion-toggle:after {
-webkit-text-stroke: 2px #eee; // Icons thinner not working
font-family: 'FontAwesome'; /* essential to enable caret symbol*/
content: "\f067";
color: white;
font-weight: bold;
float: right;
margin-left: 5px;
margin-right: 30px;
}
.collapsed:after {
content: "\f068";
}
.collapse {
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
background-color: #f1f1f1;
}发布于 2019-09-11 13:46:03
只要在你的css中去掉font-weight:加粗,
发布于 2019-09-11 14:06:42
不,你不能让字体的图标看起来更瘦,但是你使用的+图标已经是默认的字体粗细了。
您正在.accordion-toggle:after类中应用font-weight: bold;。make it font-weight: normal;它会将你的图标改变为正常的厚度。
你可以通过应用font-weight: bold;来增加字体的粗细,但是你不能使用font-weight: lighter;来减小它。
谢谢..。
发布于 2019-09-11 14:13:07
是的,你能做到。只需删除字体棒,并添加您的自定义文本,符号,任何你需要的css内容属性。
请尝试下面的CSS。
.accordion-toggle:after {
/*-webkit-text-stroke: 2px #eee; */ /*remove it*/
/* font-family: 'FontAwesome'; */ /* remove it*/
content: "+"; /*change*/
color: white;
font-weight: bold; /*remove it or change value according to you*/
float: right;
margin-left: 5px;
margin-right: 30px;
}
.collapsed:after {
content: "-";
}

https://stackoverflow.com/questions/57882784
复制相似问题