{"id":2420,"date":"2019-11-27T14:45:48","date_gmt":"2019-11-27T14:45:48","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=2420"},"modified":"2024-01-30T15:31:38","modified_gmt":"2024-01-30T15:31:38","slug":"image-size","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/css\/images-css\/image-size","title":{"rendered":"Image Size"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Image To Fill Space<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Make image fill entire space clipping if needed    \n.my_img_style {\n  object-fit: cover;\n  width: 100px;\n  height: 100px;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Resizing but keep aspect ratio<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>img.some_class {\n\tdisplay: block;\n\tmax-width: 604px;\n\tmax-height: 270px;\n\twidth: 100%;\n\theight: auto;\n}<\/code><\/pre>\n\n\n\n<p>This also works well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.some_class img {\n\tdisplay: block;\n\tmax-width: 100%;\n\tmax-height: 162px;\n\theight: auto;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Responsive \u2013 Set max width but image shrinks if necessary<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;div class=\"pfolio_image_single\" style=\"max-width:530px; margin-right: auto; margin-left: auto;\"&gt;\n    \t&lt;img src=\"images\/my_image.png\" style=\"display:block; width:100%; height:auto;\" \/&gt;\n    &lt;\/div&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Image To Fill Space Resizing but keep aspect ratio This also works well: Responsive \u2013 Set max width but image shrinks if necessary<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[205],"tags":[],"class_list":["post-2420","post","type-post","status-publish","format-standard","hentry","category-images-css"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=2420"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2420\/revisions"}],"predecessor-version":[{"id":4583,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2420\/revisions\/4583"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=2420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=2420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=2420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}