/* Getting a border */
selector .elementor-image {
position: relative;
background-color: black; /* Border Colour */
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
/* Width and Height */
width: 200px;
padding-top: 200px;
}
/* Image */
selector .elementor-image img {
position: absolute;
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
/* Border */
/* To change the border thickness, replace the 5px. */
top: 5px;
left: 5px;
width: calc(100% - (5px * 2));
height: calc(100% - (5px * 2));
}
Apply this to the Image widget, Advanced tab, Custom CSS.
Working snippet
/* Getting a border */
.elementor-image {
position: relative;
background-color: black;
/* Border Colour */
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
/* Width and Height */
width: 200px;
padding-top: 200px;
}
/* Image */
.elementor-image img {
position: absolute;
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
/* Border */
/* To change the border thickness, replace the 5px. */
top: 5px;
left: 5px;
width: calc(100% - (5px * 2));
height: calc(100% - (5px * 2));
}
<div class="elementor-image">
<img src="https://bennettfeely.com/clippy/pics/fierenze.jpg" />
</div>
You can add custom CSS to the elements. What you're looking for is clip-path
.
You can use Clippy to choose and customise the shape.
If you need more information on Custom CSS, see this Elementor Help page on Custom CSS.
Unfortunately, setting border
to get a border won't work, but there is a workaround. See this question.
Only Firefox supports external SVGs (e.g. clip-path: url(wp-uploads/XXXX/XX/mysvg.svg);
) You must use shapes (e.g. clip-path: polygon(XXX);
) or Clip Path elements defined in your document (e.g. clip-path: url(#clippathel);
). See 'Can I Use.com'.
For more info, see this CSS Tricks article.