{"id":17213,"date":"2022-04-16T08:27:33","date_gmt":"2022-04-15T23:27:33","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=17213"},"modified":"2023-05-27T18:20:13","modified_gmt":"2023-05-27T09:20:13","slug":"%e3%80%90css%e3%80%91%e3%80%8cobject-fit%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=17213","title":{"rendered":"\u3010CSS\u3011\u300c\u7f6e\u63db\u8981\u7d20\u300d\u3001\u300cobject-fit\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u300cobject-fit\u300d\u3068\u306f\uff1f<\/h2>\n<p>\u7f6e\u63db\u8981\u7d20(image\u3084video\u306a\u3069\uff09\u306b\u30b3\u30f3\u30c6\u30ca\u306e\u4e2d\u8eab\u3092\u3069\u306e\u3088\u3046\u306b\u57cb\u3081\u8fbc\u3080\u304b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3002\u308f\u304b\u308a\u3084\u3059\u304f\u8a00\u3048\u3070\u3001\u300c\u753b\u50cf\u3092\u30c8\u30ea\u30df\u30f3\u30b0\u3059\u308b\u300d\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u524d\u306f\u3001position\u30d7\u30ed\u30d1\u30c6\u30a3\u306a\u3069\u3092\u99c6\u4f7f\u3057\u3066\u9811\u5f35\u3063\u3066\u30c8\u30ea\u30df\u30f3\u30b0\u3057\u3066\u3044\u305f\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001object-fit\u3092\u4f7f\u3048\u3070\u7c21\u5358\u306a\u6307\u5b9a\u3067\u30c8\u30ea\u30df\u30f3\u30b0\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u30d7\u30ed\u30d1\u30c6\u30a3<\/th>\n<th>\u62e1\u5927\u7e2e\u5c0f<\/th>\n<th>\u30c8\u30ea\u30df\u30f3\u30b0<\/th>\n<\/tr>\n<tr>\n<td>fill<\/td>\n<td>\u5f15\u304d\u4f38\u3070\u3055\u308c\u308b<\/td>\n<td>\u00d7<\/td>\n<\/tr>\n<tr>\n<td>contain<\/td>\n<td>\u00d7<\/td>\n<td>\u00d7<\/td>\n<\/tr>\n<tr>\n<td>cover<\/td>\n<td>\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u306b\u5f93\u3063\u3066\u3055\u308c\u308b<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>none<\/td>\n<td>\u00d7<\/td>\n<td>\u25cb<\/td>\n<\/tr>\n<tr>\n<td>scale-down<\/td>\n<td>contain\u306e\u5834\u5408\u306f\u3055\u308c\u308b<\/td>\n<td>none\u306e\u5834\u5408\u306f\u3055\u308c\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>fill<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u521d\u671f\u5024\u3067\u3059\u3002<\/strong><\/span>\u8981\u7d20\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u30dc\u30c3\u30af\u30b9\u5168\u4f53\u3092\u57cb\u3081\u308b\u30b5\u30a4\u30ba\u306b\u306a\u308a\u307e\u3059\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u304c\u30dc\u30c3\u30af\u30b9\u306e\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u3068\u5408\u308f\u306a\u3044\u5834\u5408\u306f\u30dc\u30c3\u30af\u30b9\u306b\u5408\u3046\u3088\u3046\u306b\u5f15\u304d\u5ef6\u3070\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>contain<\/h3>\n<p>\u7f6e\u63db\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u3092\u7dad\u6301\u3057\u305f\u307e\u307e\u8981\u7d20\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u30dc\u30c3\u30af\u30b9\u306b\u5408\u3046\u3088\u3046\u306b\u62e1\u5927\u7e2e\u5c0f\u3055\u308c\u308b\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u30dc\u30c3\u30af\u30b9\u306e\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u304c\u9055\u3046\u5834\u5408\u306f\u30ec\u30bf\u30fc\u30dc\u30c3\u30af\u30b9\u8868\u793a\uff08\u5de6\u53f3\u3084\u4e0a\u4e0b\u306b\u9ed2\u5e2f\u304c\u51fa\u308b\u8868\u793a\uff09\u306b\u306a\u308b\u3002<\/p>\n<h3>cover<\/h3>\n<p>\u7f6e\u63db\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u3092\u7dad\u6301\u3057\u305f\u307e\u307e\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u30dc\u30c3\u30af\u30b9\u3092\u5168\u4f53\u3092\u57cb\u3081\u308b\u3088\u3046\u306b\u62e1\u5927\u7e2e\u5c0f\u3055\u308c\u308b\u3002\uff08\u306a\u306e\u3067\u3001\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u306f\u4e00\u5fdc\u5408\u3046\u3088\u3046\u306b\u3060\u304c\u5f15\u304d\u4f38\u3070\u3057\u306f\u884c\u308f\u308c\u308b\u3002\uff09<\/p>\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u304c\u30dc\u30c3\u30af\u30b9\u306e\u30a2\u30b9\u30da\u30af\u30c8\u6bd4\u306b\u5408\u308f\u306a\u3044\u5834\u5408\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u65b9\u304c\u5207\u308a\u53d6\u3089\u308c\u308b\u3002\uff08\u30c8\u30ea\u30df\u30f3\u30b0\u3082\u3055\u308c\u308b\u3002\uff09<\/p>\n<h3>none<\/h3>\n<p>\u7f6e\u63db\u30b3\u30f3\u30c6\u30f3\u30c4\u306f\u62e1\u5927\u3001\u7e2e\u5c0f\u306f\u3055\u308c\u305a\u306b\u30c8\u30ea\u30df\u30f3\u30b0\u3060\u3051\u884c\u308f\u308c\u308b\u3002<\/p>\n<h3>scale-down<\/h3>\n<p>\u30b3\u30f3\u30c6\u30f3\u30c4\u306fnone\u3001contain\u3092\u6307\u5b9a\u3057\u305f\u304b\u306e\u3088\u3046\u306b\u30b5\u30a4\u30ba\u304c\u6c7a\u3081\u3089\u308c\u3066\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b9f\u969b\u306e\u30b5\u30a4\u30ba\u304c\u5c0f\u3055\u3044\u65b9\u304c\u9078\u3070\u308c\u308b\u3002<\/p>\n<h2>\u7f6e\u63db\u8981\u7d20<\/h2>\n<p>CSS\u306e\u4e16\u754c\u3067\u306f\u300c\u30d6\u30ed\u30c3\u30af\u30ec\u30d9\u30eb\u8981\u7d20\u300d\u3068\u300c\u30a4\u30f3\u30e9\u30a4\u30f3\u8981\u7d20\u300d\u3068\u5bfe\u6bd4\u3057\u3066\u7528\u3044\u3089\u308c\u308b\u5358\u8a9e\u3067\u3059\u3002\u30c6\u30ad\u30b9\u30c8\u3067\u306f\u306a\u3044\u4f55\u304b\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u308b\u8981\u7d20\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>\u5e38\u306b\u7f6e\u63db\u8981\u7d20\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u300c\u57cb\u3081\u8fbc\u307f\u30b3\u30f3\u30c6\u30f3\u30c4\u300d<\/h3>\n<ul>\n<li>iframe<\/li>\n<li>video<\/li>\n<li>embed<\/li>\n<\/ul>\n<h3>\u5834\u5408\u306b\u3088\u3063\u3066\u7f6e\u63db\u8981\u7d20\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u300c\u57cb\u3081\u8fbc\u307f\u30b3\u30f3\u30c6\u30f3\u30c4\u300d<\/h3>\n<ul>\n<li>applet<\/li>\n<li>audio<\/li>\n<li>object<\/li>\n<li>canvas<\/li>\n<\/ul>\n<h3>\u753b\u50cf<\/h3>\n<ul>\n<li>image<\/li>\n<\/ul>\n<h2>object-position<\/h2>\n<p>object-fit:cover\u306a\u3069\u3067\u4e2d\u592e\u914d\u7f6e\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u3057\u305f\u304c\u3001\u6bce\u56de\u4e2d\u592e\u306b\u30c8\u30ea\u30df\u30f3\u30b0\u3057\u305f\u3044\u308f\u3051\u3067\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306b\u4f7f\u3048\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">object-position: \u6a2a\u306e\u4f4d\u7f6e \u7e26\u306e\u4f4d\u7f6e;<\/pre>\n","protected":false},"excerpt":{"rendered":"\u300cobject-fit\u300d\u3068\u306f\uff1f \u7f6e\u63db\u8981\u7d20(image\u3084video\u306a\u3069\uff09\u306b\u30b3\u30f3\u30c6\u30ca\u306e\u4e2d\u8eab\u3092\u3069\u306e\u3088\u3046\u306b\u57cb\u3081\u8fbc\u3080\u304b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3002\u308f\u304b\u308a\u3084\u3059\u304f\u8a00\u3048\u3070\u3001\u300c\u753b\u50cf\u3092\u30c8\u30ea\u30df\u30f3\u30b0\u3059\u308b\u300d\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002 \u4ee5\u524d\u306f\u3001position\u30d7\u30ed\u30d1\u30c6\u30a3\u306a\u3069 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[64],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/17213"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17213"}],"version-history":[{"count":7,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/17213\/revisions"}],"predecessor-version":[{"id":20125,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/17213\/revisions\/20125"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17213"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}