24-play.com Posted December 20, 2005 Share Posted December 20, 2005 A few days ago I came across some HTML code that moves an image left and right by adding pixels. Since then I've forgotton it. Does anybody know it?A friend recomended some CSS code along the lines of style="right;20px" that is imbedded in the <img> tag, but this is not the correct code. I'm certain the code I'm after is HMTL, only I've forgotten it. All I am trying to do is move an image ten or pixles to the right. Link to comment Share on other sites More sharing options...
Skemcin Posted December 20, 2005 Share Posted December 20, 2005 are you talking about <img src="xxxxxx.xxx" hspace="5" vspace="0" .... > Link to comment Share on other sites More sharing options...
scott100 Posted December 20, 2005 Share Posted December 20, 2005 this?<img style="left:10px;top:0px;position:relative;" src="xxx.jpg" /> Link to comment Share on other sites More sharing options...
24-play.com Posted December 20, 2005 Author Share Posted December 20, 2005 are you talking about <img src="xxxxxx.xxx" hspace="5" vspace="0" .... ><{POST_SNAPBACK}> Thats not the code I found - though I had seen that code in the w3c site.this?<img style="left:10px;top:0px;position:relative;" src="xxx.jpg" /><{POST_SNAPBACK}> That could well be the one. If it is, it means my friend didn't tell me the CSS code correctly, because forgive me if I'm wrong thats CSS.Thankyou both - thats solved the issue. Link to comment Share on other sites More sharing options...
King_Karlssen Posted January 9, 2006 Share Posted January 9, 2006 You can also use absolute positioning. <img src="...", style= "positionabsolute: left:'157px', top:'528px', z-index:'1'; ">You can also use percentages not only pixels when using abosolute positioning. The z-index is not necesary unless you have over-lapping pictures. The highest z-index is the picture on top. And so on. Link to comment Share on other sites More sharing options...
Skemcin Posted January 9, 2006 Share Posted January 9, 2006 now add some javascript to dynamically change the values for positioning and you have movement - since you said "moves an image left and right " in your original post. If you just need to reposition it, then the examples provided with suffice. Link to comment Share on other sites More sharing options...
Jonas Posted January 9, 2006 Share Posted January 9, 2006 You can also use absolute positioning. <img src="...", style= "positionabsolute: left:'157px', top:'528px', z-index:'1'; ">You can also use percentages not only pixels when using abosolute positioning. The z-index is not necesary unless you have over-lapping pictures. The highest z-index is the picture on top. And so on.<{POST_SNAPBACK}> I don't think you 'quote' values in css... Link to comment Share on other sites More sharing options...
King_Karlssen Posted January 10, 2006 Share Posted January 10, 2006 If anything is a little messed up with my post, I apologize. I just stated learning web page programming last summer. So the exact code is hard for me to remember sometimes. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now