css 画像を親要素の枠に収まる最大限で拡大縮小

#shop_detail .img1 {
	display: block;
	width: 400px;
	height: 300px;
	padding: 10px;
	border: 1px solid silver;
	display: table-cell;
}
#shop_detail .img1 .img1_box {
	display: block;
	width: 380px;
	height: 280px;
	text-align: center;
	object-fit: cover;
}
#shop_detail .img1 .img1_box img {
	width: 380px;
	height: 280px;
	object-fit: contain;
}

コメントを残す