ul { overflow:hidden; position:relative; list-style:none; } ul li { float:left; padding:10px 20px; background:skyblue; color:#fff; font-size:20px; cursor:pointer; transition:all .2s linear; } ul span { display:block; width:100%; height:2px; background:#f60; position:absolute; bottom:0; } ul li:hover { color:red; }
导航栏底部索引线会跟着鼠标左右滑动选中导航栏