.animated-underline { position: relative; text-decoration: none; } .animated-underline::after { content: ""; position: absolute; left: 50%; top: 100%; width: 100%; height: 0.125em; background-color: hsl(200deg, 100%, 50%); transition: transform 320ms ease; transform: translate(-50%, 0%) scaleX(0); transform-origin: right; } .animated-underline:hover::after { transform-origin: left; transform: translate(-50%, 0%) scaleX(1); }
以上是僅 CSS 中的動畫文字下劃線的詳細內容。更多資訊請關注PHP中文網其他相關文章!