Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS在一侧创建带有锐利方形边缘的边框_Html_Css - Fatal编程技术网

Html CSS在一侧创建带有锐利方形边缘的边框

Html CSS在一侧创建带有锐利方形边缘的边框,html,css,Html,Css,各位,我试图将边框添加到a元素的一侧,但是,当我将其添加到一侧时,它会给它一个尖锐的对角线边缘: 我正试图去除锋利的边缘,使其成为正方形 我曾尝试使用伪元素来实现这一点,但我没有运气: 目前,我正在使用: a{ border-left: 2px solid rgba(0, 0, 0, 0.9) !important; border-left-width: 0; border-radius: 0px; position: relative; } a::before{ bor

各位,我试图将边框添加到
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:'';
}

但这仍然给了我下面的结果。我如何才能成功地做到这一点?

看看这是否适合您:

box-shadow: -10px 0 0 0 black;

仅此而已,没有边界。

看看这是否适合您:

box-shadow: -10px 0 0 0 black;

仅此而已,没有边框。

不要在伪元素上使用边框,将伪元素设置为2px宽等。或者确保将其他边框设置为
0px
并且
position:relative的“position”拼写错误我尝试过这样做,但它只是删除了边界@Paulie_DQuestions寻求代码帮助必须包含在问题本身中复制它所需的最短代码,最好是在一个文本中。请参见不要在伪元素上使用边框,将伪元素设置为2px宽等。或者确保将其他边框设置为
0px
并且
position:relative的“position”拼写错误我尝试过这样做,但它只是删除了边界@Paulie_DQuestions寻求代码帮助必须包含在问题本身中复制它所需的最短代码,最好是在一个文本中。看见