css-边框底部的长度 [英] css- length of border bottom

查看:520
本文介绍了css-边框底部的长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个链接的样式为

a:hover {
    border-bottom: 3px solid #fff;
}

看起来像这样:

但是我需要像这样调整边框的长度:

But I need to resize the length of the border like this:

关于如何执行此操作的任何想法?谢谢

Any ideas on how I can do this? Thanks

推荐答案

这就是我要这样做的方式:

This is how I would do it:

a:hover:after {
    content: ' ';
    text-decoration: none;
    position: absolute;
    width: 50%;
    height: 100%;
    left: 0;
    margin-left: 25%;
    border-bottom: solid 3px black;
}

这是 JSFiddle 演示

这篇关于css-边框底部的长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆