Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
408 views
in Technique[技术] by (71.8m points)

html - CSS create border on one side with sharp square edges

everyone, I am trying to add border to one side of a a element, however, when I add it to one side it give it a sharp diagonal edge:

enter image description here

I am trying to remove the sharp edge and make it a square.

I have tried using pseudo-elemnts to achieve this but I have had no luck:

Currently, I am using:

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:'';
}

But this is still giving me the results below. How can I do this successfully?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

See if this works for you:

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

Just that, no borders.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...