一个网站价格,cmseasy去版权,英文域名在哪个网站查询,做网站的可以信吗首先#xff0c;给 span 标签添加一个父元素#xff0c;定义属性类名#xff1a;nav-wrapper #xff0c;父级设置相对定位。然后#xff0c;使用 ::after 伪元素来创建一个与底部边框相同宽度的元素#xff0c;初始时宽度为 0#xff0c;通过过渡动画transitio…
首先给 span 标签添加一个父元素定义属性类名nav-wrapper 父级设置相对定位。然后使用 ::after 伪元素来创建一个与底部边框相同宽度的元素初始时宽度为 0通过过渡动画transition逐渐增加宽度从而实现从左到右的过渡效果。 div classnav-wrapperspan classnav :class$route.fullPath /companyProducts ? active : 公司产品/span/div .nav-wrapper {position: relative;
}.nav::after {content: ;position: absolute;left: 0;bottom: 0;width: 0;height: 2px;background-color: red;transition: width 0.3s ease;
}.nav:hover::after,
.nav:focus::after {width: 100%;
}//当前路由样式
.active {color: #cd1e19;font-weight: 700;}