{"id":1265,"date":"2014-08-20T20:23:31","date_gmt":"2014-08-20T20:23:31","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=1265"},"modified":"2022-02-17T07:14:03","modified_gmt":"2022-02-17T07:14:03","slug":"images-3","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/css\/responsive-css\/images-3","title":{"rendered":"Images"},"content":{"rendered":"<p>\n&nbsp;\n<\/p>\n<h4>\nResizing but keep aspect ratio<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\r\nimg.some_class {\r\n\tdisplay: block;\r\n\tmax-width: 604px;\r\n\tmax-height: 270px;\r\n\twidth: auto;\r\n\theight: auto;\r\n}\r\n<\/code><\/pre>\n<p>\nThis also works well:\n<\/p>\n<pre>\r\n<code>\r\n.some_class img {\r\n\tdisplay: block;\r\n\tmax-width: 100%;\r\n\tmax-height: 162px;\r\n\theight: auto;\r\n}\r\n<\/code><\/pre>\n<h4>\nBackground Image To Fill DIV<br \/>\n<\/h4>\n<p>\nUseful for double size images for retina displays, responsive div boxes etc\n<\/p>\n<pre>\r\n<code>\r\n.top_header_logo {\r\n\tbackground-image: url(http:\/\/some_domains.com\/header_general_logo.png);\r\n\tbackground-repeat: no-repeat;\r\n\tbackground-position: center top;\r\n\tbackground-size: cover;    \/*Make image fill the div*\/\r\n\theight: 180px;\r\n\twidth: 210px;\t\r\n}\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Resizing but keep aspect ratio img.some_class { display: block; max-width: 604px; max-height: 270px; width: auto; height: auto; } This also works well: .some_class img { display: block; max-width: 100%; max-height: 162px; height: auto; } Background Image To Fill DIV Useful for double size images for retina displays, responsive div boxes etc .top_header_logo { background-image: [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[],"class_list":["post-1265","post","type-post","status-publish","format-standard","hentry","category-responsive-css"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1265","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=1265"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1265\/revisions"}],"predecessor-version":[{"id":1266,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1265\/revisions\/1266"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=1265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=1265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=1265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}