是否可以在不使用列表的情况下在 html 链接之前放置插入符? 我确实有一个列表的工作代码,但它当然不适用于单个链接:
.list-caret {
margin: 0.75em 0;
margin-left: 30px;
list-style: none;
padding: 0;
}
.list-caret li:before {
content: "";
border-color: transparent #ec6608;
border-style: solid;
border-width: 0.35em 0 0.35em 0.45em;
display: block;
height: 0;
width: 0;
left: -0.8em;
top: 1.1em;
color: #ec6608;
position: relative;
}
最佳答案
这样就可以了:
a {
padding-left: 20px;
display: inline-block;
}
a:before {
content: "";
border-color: transparent #ec6608;
border-style: solid;
border-width: 0.35em 0 0.35em 0.45em;
display: block;
height: 0;
width: 0;
left: -10px;
top: 1.1em;
color: #ec6608;
position: relative;
}
<a href="#">This is a link with a caret before on it</a>
关于html - 链接前的插入符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43227241/