点击对应的才显示underline样式的话,你需要用到a标签的四个css伪类(link、visited、hover、active) a:hover{ border-bottom:1px solid red; }
可以使用CSS伪元素 :after