I am currently working on creating a series of thumbnail-style divs with fixed dimensions. These divs will contain an image and a title text, both of which need to be centered vertically and horizontally within the container div. While I have successfully centered the image, I am struggling to position the text correctly. My goal is to achieve this design using only CSS.
.thumb {
height: 100px;
width: 96px;
padding: 3px;
cursor: pointer;
}
.thumb img,
.thumb svg {
height: 100%;
width: 100%;
max-height: 100%;
max-width: 100%;
}
.thumb div {
position: absolute;
}
<div id="Thumb" class="thumb ml-10 mt-10 float-left ui-sortable-handle">
<img src="../something.svg">
<div>Name of something</div>
</div>
If you have any suggestions for adjustments to the CSS or HTML code, please let me know.