Question

Can i use image sprites for my form submit button, tried a few things but nothing seems to work.

.button, .download, .OK, .file{
background: url(app/sprites.png) no-repeat;
 }


.button{
background-position: -1px -212px ;
width: 170px;
height: 30px;
}

My form

 <form action="add.php" method="post"  value="Username">
 <div style="float:left; margin-left:15px;"><input type="text" name="fbid" required></div>
<div style="float:left; margin-left:2px;"><input type="submit" value="Submit"></form>
Was it helpful?

Solution

Right now you are missing a class on the input.

<input type="submit" class="button" value="Submit">

With that it'll work.

I put it into a jsFiddle, using a different image because I don't have access to yours. You can play with the position, in incriments of 32px.

jsfiddle.net/CzWCv

OTHER TIPS

Have you tried

<div class="button" style="float:left; margin-left:2px;"><input type="submit"
value="Submit"></form>

??

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top