Treehouse: Grow your CSS skills. Land your dream job.

#9: Starry Night: 3D Background with the Parallax Effect

Using three layers of alpha transparent PNG files, we can can create a pseudo 3-dimensional looking background for a web page. This screencast covers how to do that from start to finish. Since Internet Explorer 6 and under do not support alpha transparency in PNG's, this screencast also covers how to create a warning message that will display only in those browsers.

Links from video:

Comments

  1. Permalink to comment#

    Who is normally resizing the browser? It would be nice if that parallax effect come in place while scrolling…

    • Permalink to comment#

      We have to see this in the light of the moment this video was set up. couple of years ago ;) (he’s even talking about ie5 n 6 while nowadays we are even discarding IE8 ;) ) nonetheless, was a nice refresh of some tricks here. parallax has found it’s place nowadays in way fancier forms.

Leave a Comment

Posting Code

We highly encourage you to post problematic HTML/CSS/JavaScript over on CodePen and include the link in your post. It's much easier to see, understand, and help with when you do that.

Markdown is supported, so you can write inline code like `<div>this</div>` or multiline blocks of code in in triple backtick fences like this:

```
<script>
  function example() {
    element.innerHTML = "<div>code</div>";
  }
</script>
```