:before /:after pseudo-element is an inline element by default, so setting width/height on this element is invalid Just like you set width/height on a element Set position: absolute; after this The display attribute of the element is calculated as the block value; but the set width/height is for the anonymous replacement element generated by :before/:after, not the content , so the size of the image has no effect
You can set the image as a background image and set the size through bakckground-size
:before /:after pseudo-element is an inline element by default, so setting width/height on this element is invalid
Just like you set width/height on a element
Set position: absolute; after this The display attribute of the element is calculated as the block value;
but the set width/height is for the anonymous replacement element generated by :before/:after, not the content
, so the size of the image has no effect