0

I have the following code:

<style>
span
{
width:200px;
height:100px;
background-color:red;
border:1px solid black;
}
span.c2
{
transform:translate(50px,100px);
-ms-transform:translate(50px,100px); /* IE 9 */
-webkit-transform:translate(50px,100px); /* Safari and Chrome */
}
</style>

<span class="c2">Hello. This is a DIV element.</span>

The problem is translate method is not getting applied to <span> element. Also the width and height specified for <span> element is not working.

What is the reason?

Rob W
  • 341,306
  • 83
  • 791
  • 678
Maizere Pathak.Nepal
  • 2,383
  • 3
  • 27
  • 41

1 Answers1

1

It does work, you need to have display: block; for span element as span element is inline, it won't translate the span element unless you make it display: block; or display: inline-block;

Demo

Related Question Of Mine

Community
  • 1
  • 1
Mr. Alien
  • 153,751
  • 34
  • 298
  • 278