CSS: How to centre pseudo elements ::before horizontally and vertically?

#element:before {
    background-image: url('Pfad zum gewünschten Bild');
    background-size: 150px 200px;
    display: block;
    width: 150px; 
    height: 200px;
    position: absolute;
    z-index: 1;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    /* Take half of the element width, in this case 200px / 2 */
    left: calc(50% - 100px);
Without cookies
This website does not use cookies or tracking. More information can be found in the privacy policy.