{"id":3464,"date":"2011-10-24T06:30:00","date_gmt":"2011-10-24T12:30:00","guid":{"rendered":"http:\/\/www.vanseodesign.com\/?p=3464"},"modified":"2011-10-24T06:30:00","modified_gmt":"2011-10-24T12:30:00","slug":"background-properties","status":"publish","type":"post","link":"https:\/\/vanseodesign.com\/css\/background-properties\/","title":{"rendered":"CSS Background: There&#8217;s More To Know Than You Think"},"content":{"rendered":"<p>You likely use <a href=\"http:\/\/www.vanseodesign.com\/css\/css-background-property\/\">css backgrounds<\/a> in every site you build. You give an element a background color and tell another element to let a background image repeat. How much do you know about all the other background properties?<br \/>\n<!--more--><br \/>\nDid you know you can control where in the background an image is painted or that you can even specify which part of an element is the background?<\/p>\n<p>I&#8217;d like to run through the different <a href=\"http:\/\/www.w3.org\/TR\/css3-background\/\">background properties<\/a> css3 offers us. Some of what follows I&#8217;m sure will be familiar to you. Some will probably be new. Hopefully this post will give you a greater understanding of a property you use all the time.<\/p>\n<p><strong>Note:<\/strong> As mentioned in the comments below support for some of what&#8217;s in this post is less than I originally thought.<\/p>\n<p>The space and round values don&#8217;t appear to be working (outside of Opera) for the background-repeat property and issues have been reported with background-position. My apologies for not being aware of these limitations earlier.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/zooboing\/5394918666\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-4.jpg\" alt=\"Background of colored stripes in a sun ray pattern\" width=\"465\" height=\"362\" \/><\/a><\/p>\n<h2>CSS Background<\/h2>\n<p>The first thing to understand is what does css consider as background and we&#8217;ll turn to the css box model with its content, padding, border, and margin for an answer.<\/p>\n<p>Everything except margins is considered background, though we&#8217;ll see in a bit that css3 allows us to alter this background painting area to some degree,<\/p>\n<p>Backgrounds can be transparent (the default), filled with color, or filled with images. Different properties determine which is used and in the case of images further properties are used to determine how the images are sized, positioned, and more.<\/p>\n<p>In practice you&#8217;ll often use the background shorthand to set all these properties, but let&#8217;s look at them individually. I&#8217;ll come back to the shorthand later in this post.<\/p>\n<h3>background-color<\/h3>\n<p>I&#8217;m sure you&#8217;ve set a css background color before. For those who&#8217;ve never used it here&#8217;s one way you&#8217;d set a background color on paragraphs.<\/p>\n<p>{code type=css}<br \/>\np {background-color: red;}<br \/>\n{\/code}<\/p>\n<p>You can also use hexadecimal or rgb notation instead.<\/p>\n<p>{code type=css}<br \/>\np {background-color: #f00;}<br \/>\np {background-color: #ff0000;}<br \/>\np {background-color: rgb(255, 0, 0;)}<br \/>\n{\/code}<\/p>\n<p>All 3 lines of css above are equivalent and set a red background on the paragraph.<\/p>\n<p>One last way to specify a <a href=\"http:\/\/www.w3.org\/TR\/css3-color\/#rgba-color\">background-color is rgba<\/a>. The &#8220;a&#8221; stands for alpha transparency and is set as a fraction between 0 and 1, with 0 being fully transparent and 1 being fully opaque.<\/p>\n<p>{code type=css}<br \/>\np {background-color: rgba(255, 0, 0, 0.5);}<br \/>\n{\/code}<\/p>\n<p>The above sets the background to the same red as before, though at 50&#37; opacity. <a href=\"http:\/\/css-tricks.com\/2151-rgba-browser-support\/\">Browser support for rgba<\/a> isn&#8217;t as good as rgb, but the fallback is generally to present the color as completely opaque or with an &#8220;a&#8221; of 1.0.<\/p>\n<p>The one thing you might not be familiar with is that the background-color will be clipped according to the background-clip property.<\/p>\n<p>We&#8217;ll get to this property shortly, but for now know it&#8217;s a way to prevent color from appearing behind the border of your element or even behind the element&#8217;s padding.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/brenda-starr\/5084485739\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-2.jpg\" alt=\"Background image of a path through the forest\" width=\"465\" height=\"322\" \/><\/a><\/p>\n<h3>background-image<\/h3>\n<p>I&#8217;m sure you&#8217;ve also set a background-image before. What&#8217;s nice is that in css3 we can add multiple images like so:<\/p>\n<p>{code type=css}<br \/>\nbody {background-image: url(&#8220;image1&#8221;), url(&#8220;image2&#8221;), url(&#8220;image3&#8221;)}<br \/>\n{\/code}<\/p>\n<p>The above adds 3 background images to the body of a document.<\/p>\n<p>Each image creates a new background <a href=\"http:\/\/www.vanseodesign.com\/css\/css-stack-z-index\/\">layer<\/a> so the images sit one on top of another. A value of none, an image with 0 width and height, or an image that fails to download still creates a new layer, though one that doesn&#8217;t show an image.<\/p>\n<p>The first image in the list is seen as being closest to the viewer and each successive image is one layer further into the background. If a background color is also specified, it&#8217;s painted below all images and is furthest from the viewer.<\/p>\n<p>There are two important guidelines you should follow when setting background-images.<\/p>\n<ul>\n<li>Specify a background-color along with background-image(s) to preserve contrast for text if the images(s) don&#8217;t display.<\/li>\n<li>Don&#8217;t use background-images to <a href=\"http:\/\/www.vanseodesign.com\/web-design\/web-design-harmony-concept-conveyance-and-theme\/\">convey important information<\/a> as they may not display in all browsers.<\/li>\n<\/ul>\n<p>Background images will be sized, positioned, and tiled according properties we&#8217;ll cover momentarily.<\/p>\n<p>With multiple images the values of these other properties will also be a comma separated list and the first value will correspond to the first image, etc.<\/p>\n<p>If there are excess values at the end of these other properties, they&#8217;ll be ignored and if there are not enough the given values are repeated until there are enough to match the images.<\/p>\n<p><a href=\"http:\/\/caniuse.com\/#search=background\">Browser support<\/a> for multiple background images is good in all browsers, except for Internet Explorer 8 and below.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/brian_reynolds\/2207257172\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/pattern.jpg\" alt=\"Repating tile pattern\" width=\"465\" height=\"267\" \/><\/a><\/p>\n<h3>background-repeat<\/h3>\n<p>Background-repeat determines how background-images are tiled and has the allowed values of no-repeat, repeat-x, repeat-y, repeat, space, and round.<\/p>\n<ul>\n<li><strong>no-repeat<\/strong> &mdash; the image isn&#8217;t tiled<\/li>\n<li><strong>repeat-x<\/strong> &mdash; the image tiles horizontally only<\/li>\n<li><strong>repeat-y<\/strong> &mdash; the image tiles vertically only<\/li>\n<li><strong>repeat<\/strong> &mdash; the image tiles both horizontally and vertically<\/li>\n<li><strong>space<\/strong> &mdash; the image will tile to fill the background with as many complete images as possible. The images wil then be spaced evenly with first and last images touching the edge<\/li>\n<li><strong>round<\/strong> &mdash; image will be tiled to fill the background with as many complete images as possible. The images will then be scaled to fit the area exactly.<\/li>\n<\/ul>\n<p>You&#8217;ve no doubt used all of the first 4 values above, but how many of you were aware of the last 2. I know I wasn&#8217;t.<\/p>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-repeat: no-repeat, repeat-y, space;<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>Assuming the 3 background images from above the first wouldn&#8217;t be repeated, the second would be repeated vertically, and the last would use the space algorithm to repeat the images both horizontally and vertically.<\/p>\n<h3>background-attachment<\/h3>\n<p>The background-attachment property determines how the image scrolls with respect to the viewport. It has the 3 values below<\/p>\n<ul>\n<li><strong>fixed<\/strong> &mdash; the image doesn&#8217;t scroll. It&#8217;s fixed where it is.<\/li>\n<li><strong>local<\/strong> &mdash; the image scrolls with the element&#8217;s content. It&#8217;s fixed to the content.<\/li>\n<li><strong>scroll<\/strong> &mdash; the image scrolls with element.  It&#8217;s fixed to element.<\/li>\n<\/ul>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-attachment: fixed;<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>The above keeps the background-image fixed in place with respect to the body.<\/p>\n<p>I can&#8217;t think of a single time I&#8217;ve ever set the background-attachment to local. Most of the time I leave it as the default (scroll), but sometimes fixing the image can make for an interesting effect.<\/p>\n<p><a href=\"http:\/\/www.w3.org\/TR\/css3-background\/#the-background-position\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-position.png\" alt=\"Diagram showing background position coordinates 50% from top and 75% from left\" width=\"465\" height=\"310\" \/><\/a><\/p>\n<h3>background-position<\/h3>\n<p>By default background images are painted at the top-left corner of an element, but they don&#8217;t have to be. You can change where they&#8217;re positioned through the background-position property.<\/p>\n<p>The background-position can be set horizontally, vertically, or both. Horizontally you can use the values center, left, and right. Vertically you can use the values center, top, and bottom. In both directions you can set a &#37; or length.<\/p>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-position: right 20px;<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>The above <a href=\"http:\/\/www.vanseodesign.com\/css\/css-positioning\/\">positions<\/a> the image 20px down along the right edge of the element.<\/p>\n<p>When 2 values are set the first is assumed to be the horizontal and the second vertical, unless the keywords say otherwise. When only one is set the second is assumed to be center.<\/p>\n<p>&#37; and length represent an offset from the top-left corner, however if 3 or 4 values are given then &#37; or length is offset from keyword<\/p>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-position: bottom 10px right 20%;<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>The above paints the image 10px from bottom and 20&#37; from right.<\/p>\n<p><a href=\"http:\/\/xjordanx.deviantart.com\/art\/Background-17006349\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-6.jpg\" alt=\"Abstract background image\" width=\"465\" height=\"349\" \/><\/a><\/p>\n<h2>CSS3 Background Properties<\/h2>\n<p>Outside of the ability to use multiple background images all of the above have been available for awhile. Below are some new background properties specific to css3.<\/p>\n<p>They <a href=\"http:\/\/caniuse.com\/#search=background-image\">work in most browsers<\/a>, however they won&#8217;t work in IE8 or below.<\/p>\n<h3>background-clip<\/h3>\n<p>Earlier in this post I mentioned that the background was everything in the element&#8217;s box except for the margins. This and the next property can alter that.<\/p>\n<p>The background-clip property determines where a background is clipped, which determines the background painting area. It has the following values<\/p>\n<ul>\n<li><strong>border-box<\/strong> &mdash; painted within (clipped to) border<\/li>\n<li><strong>padding-box<\/strong> &mdash; painted within (clipped to) padding<\/li>\n<li><strong>content-box<\/strong> &mdash; painted within (clipped to) content<\/li>\n<\/ul>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-clip: content-box;<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>The above clips the image or color so it only <a href=\"http:\/\/www.vanseodesign.com\/css\/display-property\/\">displays<\/a> behind the content part of the element&#8217;s box. The color or image will not show behind the element&#8217;s padding or border.<\/p>\n<p>This is another property I can&#8217;t claim to have used, but having learned of it I can think of times when I would want to.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/bitchbuzz\/4008573590\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/origin.jpg\" alt=\"Sign for Origin: the London Craft Fair\" width=\"465\" height=\"349\" \/><\/a><\/p>\n<h3>background-origin<\/h3>\n<p>Similar is the background-origin property, which sets the origin for the background-position property. It&#8217;s values are the same as background-clip.<\/p>\n<ul>\n<li><strong>border-box<\/strong> &mdash; positioned relative to border box<\/li>\n<li><strong>padding-box<\/strong> &mdash; positioned relative to padding box<\/li>\n<li><strong>content-box<\/strong> &mdash; positioned relative to content box<\/li>\n<\/ul>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-origin: padding-box;<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>Above the image or color would start inside the body border and behind any padding on the body.<\/p>\n<p>Note that if the background-attachment is fixed then background-position has no effect.<\/p>\n<h3>background-size<\/h3>\n<p>The last property we can set on backgrounds is background-size. While images will be whatever size they are by default (the auto value) you can control the image size in several ways.<\/p>\n<p>The obvious values are the usual &#37; and length.<\/p>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-size: 300px 40%;<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>The first value is the width and the second the height. Negative values are not permitted.<\/p>\n<p>If only one value is given, the second is assumed to be auto. When one value or both are set to auto the image size is resolved using the images aspect ratio or failing that 100&#37;.<\/p>\n<p>There are 2 other values that control how the image might be sized.<\/p>\n<ul>\n<li><strong>contain<\/strong> &mdash;  <a href=\"http:\/\/www.vanseodesign.com\/web-design\/size-scale-proportion\/\">scales<\/a> the image while preserving its aspect ratio to the largest size that both height and width can still fit within the background area<\/li>\n<li><strong>cover<\/strong> &mdash;  scales the image while preserving its aspect ratio to the smallest size that both height and width can still fit within the background area<\/li>\n<\/ul>\n<p>If neither width or height is specified then the image is sized based on the contain method above.<\/p>\n<p><a href=\"http:\/\/springlight.deviantart.com\/art\/Music-is-106389262\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/musical-shorthand.jpg\" alt=\"musical notation as shorthand\" width=\"465\" height=\"291\" \/><\/a><\/p>\n<h2>Background Property Shorthand<\/h2>\n<p>While you might set the above background properties individually, most of the time you&#8217;ll likely use the shorthand. In the past I&#8217;ve always placed the color first, the image second, and then any other properties after without thinking much to their order.<\/p>\n<p>It&#8217;s always seemed to work, but it&#8217;s incorrect. The W3C specifies the following order.<\/p>\n<ul>\n<li>&lt;bg-layer&gt; &equals; &lt;bg-image&gt; || &lt;bg-position&gt; [ \/ &lt;bg-size&gt; ]? || &lt;repeat-style&gt; || &lt;attachment&gt; || &lt;box&gt;{1,2}<\/li>\n<li>&lt;final-bg-layer&gt; &equals; &lt;bg-image&gt; || &lt;bg-position&gt; [ \/ &lt;bg-size&gt; ]? || &lt;repeat-style&gt; || &lt;attachment&gt; || &lt;box&gt;{1,2} || &lt;background-color&gt;<\/li>\n<\/ul>\n<p>{code type=css}<br \/>\nbackground-image background-position \/ background-size background-repeat background-attachment background-origin background-clip color;<br \/>\n{\/code}<\/p>\n<p>Color can only be used on the final background layer. A single background image is of course the final background layer.<\/p>\n<p>{code type=css}<br \/>\nbody {background: url(&#8220;image.png&#8221;) top left \/ 95% 95% no-repeat scroll padding-box content-box #333;}<br \/>\n{\/code}<\/p>\n<p>The above is equivalent to:<\/p>\n<p>{code type=css}<br \/>\nbody {<br \/>\n  background-image: url(&#8220;image.png&#8221;);<br \/>\n  background-position: top left;<br \/>\n  background-size: 95% 95%;<br \/>\n  background-repeat: no-repeat;<br \/>\n  background-attachment: scroll;<br \/>\n  background-origin: padding-box;<br \/>\n  background-clip: content-box;<br \/>\n  background-color: #333};<br \/>\n}<br \/>\n{\/code}<\/p>\n<p>You don&#8217;t have to <a href=\"http:\/\/www.vanseodesign.com\/css\/css-specificity-inheritance-cascaade\/\">specify a value<\/a> for every property in the shorthand. To use the shorthand on multiple images you would separate each set of values by a comma, remembering only to use a color on the last set of values.<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/andrearusky\/2240595375\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-3.jpg\" alt=\"Abstract background with a vintage feel\" width=\"465\" height=\"279\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>CSS backgrounds are something you no doubt use on every site. However you may not have been familiar with each of the different background properties available or some of the values for the properties you do know.<\/p>\n<p>While much of the time you&#8217;ll happily let defaults reign with most of these properties, a few give you some nice control over how and where your background images display.<\/p>\n<p>Browsers support is generally good for multiple images and the three new properties, origin, clip, and size, but do know that IE8 and below won&#8217;t support them.<\/p>\n<p>That may or may not be an issue depending on which browsers you need to support and how you&#8217;re using these properties.<\/p>\n<p>Hopefully this post has given you a greater understanding of a property you likely know well. Have you used any of the new properties or worked with multiple background images yet? If so how have you used them and how have they worked for you?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You likely use css backgrounds in every site you build. You give an element a background color and tell another element to let a background image repeat. How much do you know about all the other background properties?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"series":[],"class_list":["post-3464","post","type-post","status-publish","format-standard","hentry","category-css"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CSS Background: There&#039;s More To Know Than You Think - Vanseo Design<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vanseodesign.com\/css\/background-properties\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS Background: There&#039;s More To Know Than You Think - Vanseo Design\" \/>\n<meta property=\"og:description\" content=\"You likely use css backgrounds in every site you build. You give an element a background color and tell another element to let a background image repeat. How much do you know about all the other background properties?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vanseodesign.com\/css\/background-properties\/\" \/>\n<meta property=\"og:site_name\" content=\"Vanseo Design\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-24T12:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-4.jpg\" \/>\n<meta name=\"author\" content=\"Steven Bradley\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Steven Bradley\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/\"},\"author\":{\"name\":\"Steven Bradley\",\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/#\\\/schema\\\/person\\\/470cda6ba835fb52596b2e26bcbd8fe4\"},\"headline\":\"CSS Background: There&#8217;s More To Know Than You Think\",\"datePublished\":\"2011-10-24T12:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/\"},\"wordCount\":2040,\"commentCount\":29,\"image\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vanseodesign.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/background-4.jpg\",\"articleSection\":[\"CSS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/\",\"url\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/\",\"name\":\"CSS Background: There's More To Know Than You Think - Vanseo Design\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vanseodesign.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/background-4.jpg\",\"datePublished\":\"2011-10-24T12:30:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/#\\\/schema\\\/person\\\/470cda6ba835fb52596b2e26bcbd8fe4\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#primaryimage\",\"url\":\"http:\\\/\\\/www.vanseodesign.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/background-4.jpg\",\"contentUrl\":\"http:\\\/\\\/www.vanseodesign.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/10\\\/background-4.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/background-properties\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vanseodesign.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS\",\"item\":\"https:\\\/\\\/vanseodesign.com\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CSS Background: There&#8217;s More To Know Than You Think\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/#website\",\"url\":\"https:\\\/\\\/vanseodesign.com\\\/\",\"name\":\"Vanseo Design\",\"description\":\"Helping you build search engine friendly websites\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vanseodesign.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/vanseodesign.com\\\/#\\\/schema\\\/person\\\/470cda6ba835fb52596b2e26bcbd8fe4\",\"name\":\"Steven Bradley\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"\\\/\\\/www.gravatar.com\\\/avatar\\\/0f47bf400c3c1bafe06ee2884405baaa?s=96&#038;r=pg&#038;d=https%3A%2F%2Fvanseodesign.com%2Fblog%2Fwp-content%2Fthemes%2Fvanseo-design%2Fimages%2Fgravatar.png\",\"url\":\"\\\/\\\/www.gravatar.com\\\/avatar\\\/0f47bf400c3c1bafe06ee2884405baaa?s=96&#038;r=pg&#038;d=https%3A%2F%2Fvanseodesign.com%2Fblog%2Fwp-content%2Fthemes%2Fvanseo-design%2Fimages%2Fgravatar.png\",\"contentUrl\":\"\\\/\\\/www.gravatar.com\\\/avatar\\\/0f47bf400c3c1bafe06ee2884405baaa?s=96&#038;r=pg&#038;d=https%3A%2F%2Fvanseodesign.com%2Fblog%2Fwp-content%2Fthemes%2Fvanseo-design%2Fimages%2Fgravatar.png\",\"caption\":\"Steven Bradley\"},\"sameAs\":[\"https:\\\/\\\/www.vanseodesign.com\\\/about\\\/\"],\"url\":\"https:\\\/\\\/vanseodesign.com\\\/author\\\/vangogh\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSS Background: There's More To Know Than You Think - Vanseo Design","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vanseodesign.com\/css\/background-properties\/","og_locale":"en_US","og_type":"article","og_title":"CSS Background: There's More To Know Than You Think - Vanseo Design","og_description":"You likely use css backgrounds in every site you build. You give an element a background color and tell another element to let a background image repeat. How much do you know about all the other background properties?","og_url":"https:\/\/vanseodesign.com\/css\/background-properties\/","og_site_name":"Vanseo Design","article_published_time":"2011-10-24T12:30:00+00:00","og_image":[{"url":"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-4.jpg","type":"","width":"","height":""}],"author":"Steven Bradley","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Steven Bradley","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vanseodesign.com\/css\/background-properties\/#article","isPartOf":{"@id":"https:\/\/vanseodesign.com\/css\/background-properties\/"},"author":{"name":"Steven Bradley","@id":"https:\/\/vanseodesign.com\/#\/schema\/person\/470cda6ba835fb52596b2e26bcbd8fe4"},"headline":"CSS Background: There&#8217;s More To Know Than You Think","datePublished":"2011-10-24T12:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/vanseodesign.com\/css\/background-properties\/"},"wordCount":2040,"commentCount":29,"image":{"@id":"https:\/\/vanseodesign.com\/css\/background-properties\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-4.jpg","articleSection":["CSS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vanseodesign.com\/css\/background-properties\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vanseodesign.com\/css\/background-properties\/","url":"https:\/\/vanseodesign.com\/css\/background-properties\/","name":"CSS Background: There's More To Know Than You Think - Vanseo Design","isPartOf":{"@id":"https:\/\/vanseodesign.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vanseodesign.com\/css\/background-properties\/#primaryimage"},"image":{"@id":"https:\/\/vanseodesign.com\/css\/background-properties\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-4.jpg","datePublished":"2011-10-24T12:30:00+00:00","author":{"@id":"https:\/\/vanseodesign.com\/#\/schema\/person\/470cda6ba835fb52596b2e26bcbd8fe4"},"breadcrumb":{"@id":"https:\/\/vanseodesign.com\/css\/background-properties\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vanseodesign.com\/css\/background-properties\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vanseodesign.com\/css\/background-properties\/#primaryimage","url":"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-4.jpg","contentUrl":"http:\/\/www.vanseodesign.com\/blog\/wp-content\/uploads\/2011\/10\/background-4.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/vanseodesign.com\/css\/background-properties\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vanseodesign.com\/"},{"@type":"ListItem","position":2,"name":"CSS","item":"https:\/\/vanseodesign.com\/css\/"},{"@type":"ListItem","position":3,"name":"CSS Background: There&#8217;s More To Know Than You Think"}]},{"@type":"WebSite","@id":"https:\/\/vanseodesign.com\/#website","url":"https:\/\/vanseodesign.com\/","name":"Vanseo Design","description":"Helping you build search engine friendly websites","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vanseodesign.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/vanseodesign.com\/#\/schema\/person\/470cda6ba835fb52596b2e26bcbd8fe4","name":"Steven Bradley","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"\/\/www.gravatar.com\/avatar\/0f47bf400c3c1bafe06ee2884405baaa?s=96&#038;r=pg&#038;d=https%3A%2F%2Fvanseodesign.com%2Fblog%2Fwp-content%2Fthemes%2Fvanseo-design%2Fimages%2Fgravatar.png","url":"\/\/www.gravatar.com\/avatar\/0f47bf400c3c1bafe06ee2884405baaa?s=96&#038;r=pg&#038;d=https%3A%2F%2Fvanseodesign.com%2Fblog%2Fwp-content%2Fthemes%2Fvanseo-design%2Fimages%2Fgravatar.png","contentUrl":"\/\/www.gravatar.com\/avatar\/0f47bf400c3c1bafe06ee2884405baaa?s=96&#038;r=pg&#038;d=https%3A%2F%2Fvanseodesign.com%2Fblog%2Fwp-content%2Fthemes%2Fvanseo-design%2Fimages%2Fgravatar.png","caption":"Steven Bradley"},"sameAs":["https:\/\/www.vanseodesign.com\/about\/"],"url":"https:\/\/vanseodesign.com\/author\/vangogh\/"}]}},"_links":{"self":[{"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/posts\/3464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/comments?post=3464"}],"version-history":[{"count":0,"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/posts\/3464\/revisions"}],"wp:attachment":[{"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/media?parent=3464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/categories?post=3464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/tags?post=3464"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/vanseodesign.com\/wp-json\/wp\/v2\/series?post=3464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}