ARTICLE AD BOX
Asked 8 years, 8 months ago
Viewed 13k times
I need to add a border color to a css shape but i don't know how to do that. I already try with border or border-width but doesn't work.
This is my code:
Thank you
5
Pseudo-Element
A nice way to do this would be with a pseudo-element like a :before
Make exactly the same shape but slightly smaller which holds the main color you want and position it correctly and you get the border you want.
7,86020 gold badges67 silver badges92 bronze badges
3 Comments
A simple workaround is using a pseudo and transform: skew().
transform: skew() also has way better browser support than clip-path has.
Try add this:
{ ... border: 1px black solid; ... }Explain:
5 Comments
I guess why border dont adding this way - because left side is hidden, we can see this if we inspect element, so i find a way to resolve problem - parent element with necessary color with padding left equals to your expected border-size, just look: codepen.io/bennettfeely/pen/azJWWX
2017-06-02T14:29:23.067Z+00:00
Explore related questions
See similar questions with these tags.

