{"id":468,"date":"2017-03-10T06:52:28","date_gmt":"2017-03-10T06:52:28","guid":{"rendered":"http:\/\/www.thespidercloud.com\/?p=468"},"modified":"2018-05-29T06:08:47","modified_gmt":"2018-05-29T06:08:47","slug":"centering-images-with-css","status":"publish","type":"post","link":"https:\/\/frowningbear.com\/codebase\/2017\/03\/10\/centering-images-with-css\/","title":{"rendered":"Centering Images with CSS"},"content":{"rendered":"<p>img {<br \/>\ntext-align: center;<br \/>\n}<br \/>\nThat will not work as the text-align property applies to block containers, not inline elements, and img is an inline element.<\/p>\n<p>Put text-align: center on a containing block and as long as the image is still inline, it will be centered.<\/p>\n<p>If the image itself is set to block then it must have left and right margins set to auto.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>img { text-align: center; } That will not work as the text-align property applies to block containers, not inline elements, and img is an inline element. Put text-align: center on a containing block and as long as the image is still inline, it will be centered. If the image itself is set to block then &hellip; <a href=\"https:\/\/frowningbear.com\/codebase\/2017\/03\/10\/centering-images-with-css\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Centering Images with CSS&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-css"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/comments?post=468"}],"version-history":[{"count":1,"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":1215,"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/posts\/468\/revisions\/1215"}],"wp:attachment":[{"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/media?parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/categories?post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frowningbear.com\/codebase\/wp-json\/wp\/v2\/tags?post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}