I'm trying to get a CSS-only solution for a cut-off bottom right corner on every image in a page.
So far, I have come up with this:
img::after {
content: url(/images/whitecorner.png);
height: 20px;
width: 20px;
display: inline-block;
float: right;
}
But the doesn't appear in the document anywhere. (I'm using the Chrome inspector).
I hope someone can point me in the right direction. Thanks in advance!
img
is an inline element and:before
or:after
won't work , you'll have to wrap the img with a divthis is probably what you need: http://jsfiddle.net/h7Xb5/1/
this is the css:
Example
You can not use
::after
withimg
.Same with
input
s, this is because they are self closing (/>
) and hold no content.What you could do is something like this:
and then use
In my example I used:
HTML:
CSS: