Files
freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/create-texture-by-adding-a-subtle-pattern-as-a-background-image.english.md
Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

1.5 KiB

id, title, challengeType, videoUrl
id title challengeType videoUrl
587d78a5367417b2b2512ad8 Create Texture by Adding a Subtle Pattern as a Background Image 0 https://scrimba.com/c/cQdwJC8

Description

One way to add texture and interest to a background and have it stand out more is to add a subtle pattern. The key is balance, as you don't want the background to stand out too much, and take away from the foreground. The background property supports the url() function in order to link to an image of the chosen texture or pattern. The link address is wrapped in quotes inside the parentheses.

Instructions

Using the url of https://i.imgur.com/MJAkxbh.png, set the background of the whole page with the body selector.

Tests

tests:
  - text: Your <code>body</code> element should have a <code>background</code> property set to a <code>url()</code> with the given link.
    testString: assert(code.match(/background:\s*?url\(\s*("|'|)https:\/\/i\.imgur\.com\/MJAkxbh\.png\1\s*\)/gi), 'Your <code>body</code> element should have a <code>background</code> property set to a <code>url()</code> with the given link.');

Challenge Seed

<style>
  body {

  }
</style>

Solution

var code = "body {background: url('https://i.imgur.com/MJAkxbh.png')}"