# What is this code snippet for in the Survey Form example?

**URL:** <https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356>\
**Category:** General\
**Created:** [November 13, 2019, 8:09pm UTC](https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356 "2019-11-13T20:09:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![opalko](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/opalko/32/158640_2.png) [@opalko](https://forum.freecodecamp.org/u/opalko)\
**Post date:** [November 13, 2019, 8:09pm UTC](https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356/1 "2019-11-13T20:09:43Z")

</div>

Working on the Web Design project #2: Survey Form. In the example there is a bit of code I am not following:

```auto
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: -1;
  background: var(--color-darkblue);
  background-image: linear-gradient(
      115deg,
      rgba(58, 58, 158, 0.8),
      rgba(136, 136, 206, 0.7)
    ),
    url(...);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

```

Specifically the second line: `content: '';` ? It appears to insert nothing at all? Why?

Cheers  
opalko

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [November 13, 2019, 8:15pm UTC](https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356/2 "2019-11-13T20:15:33Z")

</div>

`::before` and `::after` must always have a `content` property defined.  
More information: [Create a More Complex Shape Using CSS and HTML](https://www.freecodecamp.org/learn/responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html)

---

<div class="post-metadata">

**Author:** ![opalko](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/opalko/32/158640_2.png) [@opalko](https://forum.freecodecamp.org/u/opalko)\
**Post date:** [November 13, 2019, 8:26pm UTC](https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356/3 "2019-11-13T20:26:42Z")

</div>

I couldn’t find this looking back, thanks.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [November 13, 2019, 8:27pm UTC](https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356/4 "2019-11-13T20:27:57Z")

</div>

I’m glad I could help.

---

<div class="post-metadata">

**Author:** ![opalko](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/opalko/32/158640_2.png) [@opalko](https://forum.freecodecamp.org/u/opalko)\
**Post date:** [November 13, 2019, 8:48pm UTC](https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356/5 "2019-11-13T20:48:25Z")

</div>

Ok I am still confused. Why not put the majority of that code snippet in the body {} section anyway? If it is inserting the background image / color _before_ the body element (umm…what?) what is it doing differently than just inserting it into the body element directly? When I try just that the difference I see is that the image is not “shrunk” to the page but otherwise the same.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 11:34am UTC](https://forum.freecodecamp.org/t/what-is-this-code-snippet-for-in-the-survey-form-example/326356/6 "2021-01-16T11:34:19Z")

</div>

Closed on January 16, 2021, 11:34am UTC


