I think it depends on your project. Will yours be used <div>only for this purpose? and will all background images be centered? If so, then this is probably good, but if you think that you will overwrite them for other elements in your project, this can cause problems when developing your application.
Why don't you try something like this:
<div class="center-image" style="background-image: url('https://i.stack.imgur.com/RhYGF.png')"></div>
.center-image {
height: 100px;
width: 100px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
:
<div class="center-image-wrapper">
<div style="background-image: url(path-to-img1)"></div>
<div style="background-image: url(path-to-img2)"></div>
<div style="background-image: url(path-to-img3)"></div>
</div>
.center-image-wrapper > div {
height: 100px;
width: 100px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
, display:block div. div .