CSS如何添加錨點(diǎn)
1. 在HTML中添加錨點(diǎn):錨點(diǎn)以一個(gè)點(diǎn)號(hào)(.)開(kāi)頭,后面跟著一個(gè)或多個(gè)元素名。例如:
.link-to-element {
position: relative;
top: 10px;
.link-to-element:after {
content: "";
position: absolute;
top: 20px;
left: 10px;
width: 10px;
height: 10px;
background-color: red;
transform: rotate(-45deg);
transform-origin: 0 100%;
.link-to-element {
display: inline-block;
width: 20px;
height: 20px;
border: 1px solid #ccc;
border-radius: 50%;
cursor: pointer;
.link-to-element:hover {
background-color: #4CAF50;