ironchicken 0 Report post Posted January 27, 2008 I want to know how to put an image anywhere in the page using HTML/JavaScript.Please Help. Share this post Link to post Share on other sites
rvalkass 5 Report post Posted January 27, 2008 To put an image on the page you use the IMG tag: <img src="path/to/image.png" width="200" height="150" alt="Alternative text if image cannot be displayed" /> src defines the path to the image. Width and height are fairly obvious, measured in pixels. Alt is text which gets displayed if the user has a text-based browser, the image can't be downloaded or anything like that. It is also shown when the user mouses over the image. The image will appear wherever you put that tag. W3Schools have a good guide to using the IMG tag which I advise you read through. To literally position it "anywhere in the page" you'd need to use some CSS to position it where you wanted, most likely using absolute positioning. This page has a quick guide to using CSS, and that link specifically goes to an example of absolutely positioning an image. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted January 27, 2008 You do not need to use absolute positioning, either.Floats, Margins and Padding can be used to place block-level items on the page.Do you have a page of code for us to look at and assist with your layout problem? If so, post it up.thanks. Share this post Link to post Share on other sites