0

I have never coded before so i dont know much, i watched this youtube video on how to make a js button youtube video

<div style="position:absolute; margin-left:1202px;"
<input type="image" src="images/login.png"
onmouseover="javascript:this.src='images/loginpressed.png';" 
onmouseout="javascript:this.src='images/login.png';" />
</div>

i can see that the code works in dreamweaver, but for somereason, others cannot see it on the website

1
  • Use a absolute address for your picture like: placekitten.com/20/20 to find the problem Commented Jul 18, 2013 at 9:45

2 Answers 2

5

You forgot a > after <div style="position:absolute; margin-left:1202px;". Because of that, the button is now part of your div's declaration.

B.t.w. You can achieve a similar result by using another element than input type=image, like a span or div or an actual link element (a href) and apply some CSS to give it a different background image. For instance:

HTML:

<span class="button" onclick="alert('clicked');">Caption</span>

CSS:

.button {
  display: inline-block;
  height: 30px;
  background-image: url(normalstate.png);
}
.button:hover {
  background-image: url(hoverstate.png);
}
Sign up to request clarification or add additional context in comments.

Comments

0

It may possible that path to your images not found at other place.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.