{"id":1712,"date":"2015-02-12T12:00:03","date_gmt":"2015-02-12T11:00:03","guid":{"rendered":"http:\/\/www.unicoda.com\/?p=1712"},"modified":"2015-02-08T13:03:38","modified_gmt":"2015-02-08T12:03:38","slug":"cover-picture-background","status":"publish","type":"post","link":"https:\/\/www.unicoda.com\/?p=1712","title":{"rendered":"Cover Picture Background"},"content":{"rendered":"<p>I wanted to display a picture in the background of a page for a project of mine. I&rsquo;ve already used this solution twice. It works good and looks really great.<\/p>\n<p>Here is the code using the property <em>background-size<\/em> from CSS3.<\/p>\n<pre>body {\r\n  \/*Full picture in the background.*\/\r\n  background: url(background.jpg) no-repeat center center fixed;\r\n  -webkit-background-size: cover;\r\n  -moz-background-size: cover;\r\n  -o-background-size: cover;\r\n  background-size: cover;\r\n}<\/pre>\n<p>So, as an example, this is the original picture I&rsquo;ve used.<\/p>\n<figure id=\"attachment_1760\" aria-describedby=\"caption-attachment-1760\" style=\"width: 584px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/background.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1760 size-large\" src=\"https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/background-1024x683.jpg\" alt=\"Original Picture\" width=\"584\" height=\"390\" srcset=\"https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/background-1024x683.jpg 1024w, https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/background-300x200.jpg 300w, https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/background-450x300.jpg 450w\" sizes=\"auto, (max-width: 584px) 85vw, 584px\" \/><\/a><figcaption id=\"caption-attachment-1760\" class=\"wp-caption-text\">French singer Martial from the band Manau.<\/figcaption><\/figure>\n<p>And this is how it looks when used as a cover picture in my project Orchestre.<\/p>\n<p><a href=\"https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/fullScreenBackground.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1761\" src=\"https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/fullScreenBackground-1024x554.png\" alt=\"fullScreenBackground\" width=\"584\" height=\"316\" srcset=\"https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/fullScreenBackground-1024x554.png 1024w, https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/fullScreenBackground-300x162.png 300w, https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/fullScreenBackground-500x271.png 500w, https:\/\/www.unicoda.com\/wp-content\/uploads\/2015\/02\/fullScreenBackground.png 1360w\" sizes=\"auto, (max-width: 584px) 85vw, 584px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to display a picture in the background of a page for a project of mine. I&rsquo;ve already used this solution twice. It works good and looks really great. Here is the code using the property background-size from CSS3. body { \/*Full picture in the background.*\/ background: url(background.jpg) no-repeat center center fixed; -webkit-background-size: cover; &hellip; <a href=\"https:\/\/www.unicoda.com\/?p=1712\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Cover Picture Background&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[218,220,219,217],"class_list":["post-1712","post","type-post","status-publish","format-standard","hentry","category-code","tag-background","tag-cover-picture","tag-css","tag-full-screen"],"_links":{"self":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/1712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1712"}],"version-history":[{"count":5,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/1712\/revisions"}],"predecessor-version":[{"id":1765,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/1712\/revisions\/1765"}],"wp:attachment":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}