{"id":136,"date":"2009-02-13T17:35:57","date_gmt":"2009-02-13T22:35:57","guid":{"rendered":"http:\/\/www.blizzarddigital.com\/blog\/?p=136"},"modified":"2010-04-18T19:41:24","modified_gmt":"2010-04-18T23:41:24","slug":"img-vs-background-image","status":"publish","type":"post","link":"https:\/\/www.blizzarddigital.com\/blog\/img-vs-background-image\/","title":{"rendered":"The img Element Vs the CSS background-image Property"},"content":{"rendered":"<p>Don&#8217;t know when to use the <em>img<\/em> element or when to use the CSS <em>background-image<\/em> property? Don&#8217;t fret; there is hope. Read further and all shall be revealed.<\/p>\n<p>The <em>img<\/em> element is best used for pictures that are completely unrelated to the stylesheet. That is, pictures that would need to display no matter how much the look of the site changes. These would be pictures related to a news\u00a0article or photos in a gallery.<\/p>\n<p>The CSS <em>background-image<\/em> property is for images that make up the appearance of the stylesheet. These pictures on one stylesheet\u00a0would be different or just completely absent on another stylesheet. They don&#8217;t add to the content of the page in any way and are only there to give the page its &#8220;look&#8221;. These image files would be stored in the stylesheet&#8217;s <em>images<\/em> folder. (See my <a title=\"Organizing Your CSS Files\" href=\"\/organizing-your-css-files\/\">last post<\/a> for more on this.)<\/p>\n<p>Just another tip from your uncle Kyle!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find out when to use the img element or when to use the CSS background-image property.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[20,6,25,19],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-web-standards","tag-css","tag-web-design","tag-web-development","tag-xhtml"],"_links":{"self":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":3,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":660,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts\/136\/revisions\/660"}],"wp:attachment":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/categories?post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/tags?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}