I have a div element with a triangular border, and I'm trying to place an image above it using the ::after pseudo-element with background-image . However, the method does not work. However, if I try to set content: "asd"; , the text will be displayed correctly. Basically, I just want to have an image of the house above this triangle.
Here is the HTML code:
<div id = "estatecorner" class = "house"></div>
And here is the CSS:
#estatecorner { position: absolute; right: 0px; width: 0; height: 0; border-style: solid; border-width: 0 80px 80px 0; border-color: transparent #67b2e4 transparent transparent; } #estatecorner.house::after { position: absolute; width: 100%; height: 100%; background: url(images/mini/house.png); content: " "; }
Here jsFiddle
source share