0

I'm new to Play. I'm wondering how to put an image on top of another. I used this method

<div style="position: relative; left: 0; top: 0;">
  <img src="a.jpg" style="position: relative; top: 0; left: 0;"/>
  <img src="b.jpg" style="position: absolute; top: 30; left: 70;"/>
</div>

from How do I position one image on top of another in HTML?

But running on Play, it just didn't work. The images are positioned side by side, and changing the "top" and "left" value didn't make any difference.

And I ran the static html file with static path to image, it worked. I'm quite confusing right now.

I'm using Play 2.2.0.

Community
  • 1
  • 1
YiFeng
  • 961
  • 2
  • 7
  • 15

1 Answers1

0

There is no any reason to blame Play as in your case it doesn't even generate the code just displays it...

Add unit to the non-zero values, that should help.

<div style="position: relative; left: 0; top: 0;">
  <img src="a.jpg" style="position: relative; top: 0; left: 0;"/>
  <img src="b.jpg" style="position: absolute; top: 30px; left: 70px;"/>
</div>
biesior
  • 55,576
  • 10
  • 125
  • 182
  • 1
    yeap, 0-values can also use the units, anyway that's redundant (modern IDEs highlight it as an error). The most important is that non-zero vals REQUIRES the units. – biesior Oct 23 '13 at 19:42