大家,我想在 a
元素的一侧添加边框,但是,当我将它添加到一侧时,它会给它一个尖锐的对角边缘:
我正在尝试去除锋利的边缘并使其成为正方形。
我曾尝试使用伪元素来实现这一点,但我没有运气:
目前,我正在使用:
a{
border-left: 2px solid rgba(0, 0, 0, 0.9) !important;
border-left-width: 0;
border-radius: 0px;
position: relative;
}
a::before{
border-left: 2px solid rgba(0, 0, 0, 0.9) !important;
border-radius: 0px;
position:absolute;
content:'';
}
但这仍然给我下面的结果。我怎样才能成功地做到这一点?
答案 0 :(得分:2)
看看这是否适合您:
box-shadow: -10px 0 0 0 black;
就是这样,没有边界。