Roberto Bahia
Roberto Bahia

Reputation: 105

javascript with html set image position error

I have the follow code, it show the picture but don't set the position, where is the problem?

                  document.write("<IMG ALIGN='center' "+
                "style=position:absolute; left: 400; top: 100 " +
                "SRC='http://www.uairobotics.com/tomada/Images/farol.png'> " +
               "<BR><BR>"); 

thank you

Roberto

Upvotes: 1

Views: 60

Answers (2)

Jakir Hossain
Jakir Hossain

Reputation: 2517

document.write("<IMG ALIGN='center' style='position:absolute; left: 400px; top: 100px' SRC='http://www.uairobotics.com/tomada/Images/farol.png'> " +
               "<BR><BR>");

demo

Upvotes: 1

Danyal Sandeelo
Danyal Sandeelo

Reputation: 12391

Try this one, you missed ' in style attribute.

            document.write("<IMG ALIGN='center' "+
            "style='position:absolute; left: 400; top: 100' " +
            "SRC='http://www.uairobotics.com/tomada/Images/farol.png'> " +
           "<BR><BR>"); 

Upvotes: 2

Related Questions