Came across the same problem, If you're open to a different approach try as below.
.img::before { content: "Alternate Text Here"; display: block; } .img::after { content: ""; display: block; }