{"id":522,"date":"2017-10-19T10:50:37","date_gmt":"2017-10-19T15:50:37","guid":{"rendered":"https:\/\/www.marcblase.com\/blog\/?p=522"},"modified":"2017-10-19T10:59:30","modified_gmt":"2017-10-19T15:59:30","slug":"css-method-to-force-square-containers","status":"publish","type":"post","link":"https:\/\/ma.rcbla.se\/blog\/2017\/10\/css-method-to-force-square-containers\/","title":{"rendered":"CSS method to force square containers"},"content":{"rendered":"<p>This method is especially helpful in laying out Instagram images in a grid since they have rolled out their non-square media ability.<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\/\/ HTML\r\n&lt;a href=&quot;LINK_GOES_HERE&quot; class=&quot;square&quot;&gt;\r\n    &lt;img src=&quot;IMG_GOES_HERE&quot; alt=&quot;&quot;&gt;\r\n&lt;\/a&gt;\r\n<\/pre>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n\/\/ SCSS\r\n.square {\r\n    width: 100%;\r\n    height: 0;\r\n    padding-bottom: 100%;\r\n    display: block;\r\n\r\n    img {\r\n        width:100%;\r\n        height:auto;\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This method is especially helpful in laying out Instagram images in a grid since they have rolled out their non-square media ability. \/\/ HTML &lt;a href=&quot;LINK_GOES_HERE&quot; class=&quot;square&quot;&gt; &lt;img src=&quot;IMG_GOES_HERE&quot; alt=&quot;&quot;&gt; &lt;\/a&gt; \/\/ SCSS .square { width: 100%; height: 0; padding-bottom: 100%; display: block; img { width:100%; height:auto; } }<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,3],"tags":[],"class_list":["post-522","post","type-post","status-publish","format-standard","hentry","category-css-coding","category-discoveries"],"_links":{"self":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/comments?post=522"}],"version-history":[{"count":4,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/522\/revisions"}],"predecessor-version":[{"id":526,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/522\/revisions\/526"}],"wp:attachment":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/media?parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/categories?post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/tags?post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}