Using multiple class in one div with images

css, html

Solution

Now add `position: relative;` on your `.title` class

As like this:

.title {
  position: relative;
}

Demo

Problem

I'm using two classes in one div. The problem I'm having is I have two different `title` divs and each title will have its own image. I cannot figure out why each title will not display its own image. Both images will stack up on the first div, what am I doing wrong? Demo http://jsfiddle.net/mRRA4/ CSS ``` .title { border: 1px solid #AAA; padding: 4px 22px; } .icon-img1:before { position: absolute; top: 4px; left: 4px; content: ""; background: url(http://png-4.findicons.com/files/icons/366/icomic/24/images.png); width: 24px; height: 24px; } .icon-img2:before { position: absolute; top: 4px; left: 4px; content: ""; background: url(http://png-5.findicons.com/files/icons/753/gnome_desktop/24/gnome_emblem_photos.png); width: 24px; height: 24px; } ``` HTML ``` <div class="title icon-img1">Title 1</div> <div class="title icon-img2">Title 2 </div> ```

Original source