讓圖片在上層容器內水平與垂直置中,可用 flex 或 table-cell。
.thumb {
width: 260px;
height: 260px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid red;
}若需相容舊瀏覽器,也可用 display: table-cell 搭配 vertical-align: middle 與 text-align: center。